(() => { var __create = Object.create; var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropNames = Object.getOwnPropertyNames; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b ||= {}) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __esm = (fn2, res) => function __init() { return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res; }; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { try { step(generator.next(value)); } catch (e) { reject(e); } }; var rejected = (value) => { try { step(generator.throw(value)); } catch (e) { reject(e); } }; var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; // node_modules/@rails/actioncable/src/adapters.js var adapters_default; var init_adapters = __esm({ "node_modules/@rails/actioncable/src/adapters.js"() { adapters_default = { logger: self.console, WebSocket: self.WebSocket }; } }); // node_modules/@rails/actioncable/src/logger.js var logger_default; var init_logger = __esm({ "node_modules/@rails/actioncable/src/logger.js"() { init_adapters(); logger_default = { log(...messages) { if (this.enabled) { messages.push(Date.now()); adapters_default.logger.log("[ActionCable]", ...messages); } } }; } }); // node_modules/@rails/actioncable/src/connection_monitor.js var now, secondsSince, ConnectionMonitor, connection_monitor_default; var init_connection_monitor = __esm({ "node_modules/@rails/actioncable/src/connection_monitor.js"() { init_logger(); now = () => (/* @__PURE__ */ new Date()).getTime(); secondsSince = (time) => (now() - time) / 1e3; ConnectionMonitor = class { constructor(connection) { this.visibilityDidChange = this.visibilityDidChange.bind(this); this.connection = connection; this.reconnectAttempts = 0; } start() { if (!this.isRunning()) { this.startedAt = now(); delete this.stoppedAt; this.startPolling(); addEventListener("visibilitychange", this.visibilityDidChange); logger_default.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`); } } stop() { if (this.isRunning()) { this.stoppedAt = now(); this.stopPolling(); removeEventListener("visibilitychange", this.visibilityDidChange); logger_default.log("ConnectionMonitor stopped"); } } isRunning() { return this.startedAt && !this.stoppedAt; } recordPing() { this.pingedAt = now(); } recordConnect() { this.reconnectAttempts = 0; this.recordPing(); delete this.disconnectedAt; logger_default.log("ConnectionMonitor recorded connect"); } recordDisconnect() { this.disconnectedAt = now(); logger_default.log("ConnectionMonitor recorded disconnect"); } // Private startPolling() { this.stopPolling(); this.poll(); } stopPolling() { clearTimeout(this.pollTimeout); } poll() { this.pollTimeout = setTimeout( () => { this.reconnectIfStale(); this.poll(); }, this.getPollInterval() ); } getPollInterval() { const { staleThreshold, reconnectionBackoffRate } = this.constructor; const backoff = Math.pow(1 + reconnectionBackoffRate, Math.min(this.reconnectAttempts, 10)); const jitterMax = this.reconnectAttempts === 0 ? 1 : reconnectionBackoffRate; const jitter = jitterMax * Math.random(); return staleThreshold * 1e3 * backoff * (1 + jitter); } reconnectIfStale() { if (this.connectionIsStale()) { logger_default.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${secondsSince(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`); this.reconnectAttempts++; if (this.disconnectedRecently()) { logger_default.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${secondsSince(this.disconnectedAt)} s`); } else { logger_default.log("ConnectionMonitor reopening"); this.connection.reopen(); } } } get refreshedAt() { return this.pingedAt ? this.pingedAt : this.startedAt; } connectionIsStale() { return secondsSince(this.refreshedAt) > this.constructor.staleThreshold; } disconnectedRecently() { return this.disconnectedAt && secondsSince(this.disconnectedAt) < this.constructor.staleThreshold; } visibilityDidChange() { if (document.visibilityState === "visible") { setTimeout( () => { if (this.connectionIsStale() || !this.connection.isOpen()) { logger_default.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`); this.connection.reopen(); } }, 200 ); } } }; ConnectionMonitor.staleThreshold = 6; ConnectionMonitor.reconnectionBackoffRate = 0.15; connection_monitor_default = ConnectionMonitor; } }); // node_modules/@rails/actioncable/src/internal.js var internal_default; var init_internal = __esm({ "node_modules/@rails/actioncable/src/internal.js"() { internal_default = { "message_types": { "welcome": "welcome", "disconnect": "disconnect", "ping": "ping", "confirmation": "confirm_subscription", "rejection": "reject_subscription" }, "disconnect_reasons": { "unauthorized": "unauthorized", "invalid_request": "invalid_request", "server_restart": "server_restart" }, "default_mount_path": "/cable", "protocols": [ "actioncable-v1-json", "actioncable-unsupported" ] }; } }); // node_modules/@rails/actioncable/src/connection.js var message_types, protocols, supportedProtocols, indexOf, Connection, connection_default; var init_connection = __esm({ "node_modules/@rails/actioncable/src/connection.js"() { init_adapters(); init_connection_monitor(); init_internal(); init_logger(); ({ message_types, protocols } = internal_default); supportedProtocols = protocols.slice(0, protocols.length - 1); indexOf = [].indexOf; Connection = class { constructor(consumer2) { this.open = this.open.bind(this); this.consumer = consumer2; this.subscriptions = this.consumer.subscriptions; this.monitor = new connection_monitor_default(this); this.disconnected = true; } send(data) { if (this.isOpen()) { this.webSocket.send(JSON.stringify(data)); return true; } else { return false; } } open() { if (this.isActive()) { logger_default.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`); return false; } else { logger_default.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${protocols}`); if (this.webSocket) { this.uninstallEventHandlers(); } this.webSocket = new adapters_default.WebSocket(this.consumer.url, protocols); this.installEventHandlers(); this.monitor.start(); return true; } } close({ allowReconnect } = { allowReconnect: true }) { if (!allowReconnect) { this.monitor.stop(); } if (this.isOpen()) { return this.webSocket.close(); } } reopen() { logger_default.log(`Reopening WebSocket, current state is ${this.getState()}`); if (this.isActive()) { try { return this.close(); } catch (error2) { logger_default.log("Failed to reopen WebSocket", error2); } finally { logger_default.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`); setTimeout(this.open, this.constructor.reopenDelay); } } else { return this.open(); } } getProtocol() { if (this.webSocket) { return this.webSocket.protocol; } } isOpen() { return this.isState("open"); } isActive() { return this.isState("open", "connecting"); } // Private isProtocolSupported() { return indexOf.call(supportedProtocols, this.getProtocol()) >= 0; } isState(...states) { return indexOf.call(states, this.getState()) >= 0; } getState() { if (this.webSocket) { for (let state in adapters_default.WebSocket) { if (adapters_default.WebSocket[state] === this.webSocket.readyState) { return state.toLowerCase(); } } } return null; } installEventHandlers() { for (let eventName in this.events) { const handler = this.events[eventName].bind(this); this.webSocket[`on${eventName}`] = handler; } } uninstallEventHandlers() { for (let eventName in this.events) { this.webSocket[`on${eventName}`] = function() { }; } } }; Connection.reopenDelay = 500; Connection.prototype.events = { message(event2) { if (!this.isProtocolSupported()) { return; } const { identifier, message, reason, reconnect, type } = JSON.parse(event2.data); switch (type) { case message_types.welcome: this.monitor.recordConnect(); return this.subscriptions.reload(); case message_types.disconnect: logger_default.log(`Disconnecting. Reason: ${reason}`); return this.close({ allowReconnect: reconnect }); case message_types.ping: return this.monitor.recordPing(); case message_types.confirmation: this.subscriptions.confirmSubscription(identifier); return this.subscriptions.notify(identifier, "connected"); case message_types.rejection: return this.subscriptions.reject(identifier); default: return this.subscriptions.notify(identifier, "received", message); } }, open() { logger_default.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`); this.disconnected = false; if (!this.isProtocolSupported()) { logger_default.log("Protocol is unsupported. Stopping monitor and disconnecting."); return this.close({ allowReconnect: false }); } }, close(event2) { logger_default.log("WebSocket onclose event"); if (this.disconnected) { return; } this.disconnected = true; this.monitor.recordDisconnect(); return this.subscriptions.notifyAll("disconnected", { willAttemptReconnect: this.monitor.isRunning() }); }, error() { logger_default.log("WebSocket onerror event"); } }; connection_default = Connection; } }); // node_modules/@rails/actioncable/src/subscription.js var extend, Subscription; var init_subscription = __esm({ "node_modules/@rails/actioncable/src/subscription.js"() { extend = function(object, properties) { if (properties != null) { for (let key in properties) { const value = properties[key]; object[key] = value; } } return object; }; Subscription = class { constructor(consumer2, params = {}, mixin) { this.consumer = consumer2; this.identifier = JSON.stringify(params); extend(this, mixin); } // Perform a channel action with the optional data passed as an attribute perform(action, data = {}) { data.action = action; return this.send(data); } send(data) { return this.consumer.send({ command: "message", identifier: this.identifier, data: JSON.stringify(data) }); } unsubscribe() { return this.consumer.subscriptions.remove(this); } }; } }); // node_modules/@rails/actioncable/src/subscription_guarantor.js var SubscriptionGuarantor, subscription_guarantor_default; var init_subscription_guarantor = __esm({ "node_modules/@rails/actioncable/src/subscription_guarantor.js"() { init_logger(); SubscriptionGuarantor = class { constructor(subscriptions) { this.subscriptions = subscriptions; this.pendingSubscriptions = []; } guarantee(subscription) { if (this.pendingSubscriptions.indexOf(subscription) == -1) { logger_default.log(`SubscriptionGuarantor guaranteeing ${subscription.identifier}`); this.pendingSubscriptions.push(subscription); } else { logger_default.log(`SubscriptionGuarantor already guaranteeing ${subscription.identifier}`); } this.startGuaranteeing(); } forget(subscription) { logger_default.log(`SubscriptionGuarantor forgetting ${subscription.identifier}`); this.pendingSubscriptions = this.pendingSubscriptions.filter((s) => s !== subscription); } startGuaranteeing() { this.stopGuaranteeing(); this.retrySubscribing(); } stopGuaranteeing() { clearTimeout(this.retryTimeout); } retrySubscribing() { this.retryTimeout = setTimeout( () => { if (this.subscriptions && typeof this.subscriptions.subscribe === "function") { this.pendingSubscriptions.map((subscription) => { logger_default.log(`SubscriptionGuarantor resubscribing ${subscription.identifier}`); this.subscriptions.subscribe(subscription); }); } }, 500 ); } }; subscription_guarantor_default = SubscriptionGuarantor; } }); // node_modules/@rails/actioncable/src/subscriptions.js var Subscriptions; var init_subscriptions = __esm({ "node_modules/@rails/actioncable/src/subscriptions.js"() { init_subscription(); init_subscription_guarantor(); init_logger(); Subscriptions = class { constructor(consumer2) { this.consumer = consumer2; this.guarantor = new subscription_guarantor_default(this); this.subscriptions = []; } create(channelName, mixin) { const channel = channelName; const params = typeof channel === "object" ? channel : { channel }; const subscription = new Subscription(this.consumer, params, mixin); return this.add(subscription); } // Private add(subscription) { this.subscriptions.push(subscription); this.consumer.ensureActiveConnection(); this.notify(subscription, "initialized"); this.subscribe(subscription); return subscription; } remove(subscription) { this.forget(subscription); if (!this.findAll(subscription.identifier).length) { this.sendCommand(subscription, "unsubscribe"); } return subscription; } reject(identifier) { return this.findAll(identifier).map((subscription) => { this.forget(subscription); this.notify(subscription, "rejected"); return subscription; }); } forget(subscription) { this.guarantor.forget(subscription); this.subscriptions = this.subscriptions.filter((s) => s !== subscription); return subscription; } findAll(identifier) { return this.subscriptions.filter((s) => s.identifier === identifier); } reload() { return this.subscriptions.map((subscription) => this.subscribe(subscription)); } notifyAll(callbackName, ...args) { return this.subscriptions.map((subscription) => this.notify(subscription, callbackName, ...args)); } notify(subscription, callbackName, ...args) { let subscriptions; if (typeof subscription === "string") { subscriptions = this.findAll(subscription); } else { subscriptions = [subscription]; } return subscriptions.map((subscription2) => typeof subscription2[callbackName] === "function" ? subscription2[callbackName](...args) : void 0); } subscribe(subscription) { if (this.sendCommand(subscription, "subscribe")) { this.guarantor.guarantee(subscription); } } confirmSubscription(identifier) { logger_default.log(`Subscription confirmed ${identifier}`); this.findAll(identifier).map((subscription) => this.guarantor.forget(subscription)); } sendCommand(subscription, command) { const { identifier } = subscription; return this.consumer.send({ command, identifier }); } }; } }); // node_modules/@rails/actioncable/src/consumer.js function createWebSocketURL(url) { if (typeof url === "function") { url = url(); } if (url && !/^wss?:/i.test(url)) { const a = document.createElement("a"); a.href = url; a.href = a.href; a.protocol = a.protocol.replace("http", "ws"); return a.href; } else { return url; } } var Consumer; var init_consumer = __esm({ "node_modules/@rails/actioncable/src/consumer.js"() { init_connection(); init_subscriptions(); Consumer = class { constructor(url) { this._url = url; this.subscriptions = new Subscriptions(this); this.connection = new connection_default(this); } get url() { return createWebSocketURL(this._url); } send(data) { return this.connection.send(data); } connect() { return this.connection.open(); } disconnect() { return this.connection.close({ allowReconnect: false }); } ensureActiveConnection() { if (!this.connection.isActive()) { return this.connection.open(); } } }; } }); // node_modules/@rails/actioncable/src/index.js var src_exports = {}; __export(src_exports, { Connection: () => connection_default, ConnectionMonitor: () => connection_monitor_default, Consumer: () => Consumer, INTERNAL: () => internal_default, Subscription: () => Subscription, SubscriptionGuarantor: () => subscription_guarantor_default, Subscriptions: () => Subscriptions, adapters: () => adapters_default, createConsumer: () => createConsumer, createWebSocketURL: () => createWebSocketURL, getConfig: () => getConfig, logger: () => logger_default }); function createConsumer(url = getConfig("url") || internal_default.default_mount_path) { return new Consumer(url); } function getConfig(name) { const element = document.head.querySelector(`meta[name='action-cable-${name}']`); if (element) { return element.getAttribute("content"); } } var init_src = __esm({ "node_modules/@rails/actioncable/src/index.js"() { init_connection(); init_connection_monitor(); init_consumer(); init_internal(); init_subscription(); init_subscriptions(); init_subscription_guarantor(); init_adapters(); init_logger(); } }); // node_modules/croppr/dist/croppr.js var require_croppr = __commonJS({ "node_modules/croppr/dist/croppr.js"(exports, module) { (function(global2, factory) { typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.Croppr = factory(); })(exports, function() { "use strict"; (function() { var lastTime = 0; var vendors = ["ms", "moz", "webkit", "o"]; for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { window.requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"]; window.cancelAnimationFrame = window[vendors[x] + "CancelAnimationFrame"] || window[vendors[x] + "CancelRequestAnimationFrame"]; } if (!window.requestAnimationFrame) window.requestAnimationFrame = function(callback, element) { var currTime = (/* @__PURE__ */ new Date()).getTime(); var timeToCall = Math.max(0, 16 - (currTime - lastTime)); var id = window.setTimeout(function() { callback(currTime + timeToCall); }, timeToCall); lastTime = currTime + timeToCall; return id; }; if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function(id) { clearTimeout(id); }; })(); (function() { if (typeof window.CustomEvent === "function") return false; function CustomEvent2(event2, params) { params = params || { bubbles: false, cancelable: false, detail: void 0 }; var evt = document.createEvent("CustomEvent"); evt.initCustomEvent(event2, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent2.prototype = window.Event.prototype; window.CustomEvent = CustomEvent2; })(); (function(window2) { try { new CustomEvent("test"); return false; } catch (e) { } function MouseEvent2(eventType, params) { params = params || { bubbles: false, cancelable: false }; var mouseEvent = document.createEvent("MouseEvent"); mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, window2, 0, 0, 0, 0, 0, false, false, false, false, 0, null); return mouseEvent; } MouseEvent2.prototype = Event.prototype; window2.MouseEvent = MouseEvent2; })(window); var classCallCheck = function(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var get4 = function get5(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === void 0) { var parent = Object.getPrototypeOf(object); if (parent === null) { return void 0; } else { return get5(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === void 0) { return void 0; } return getter.call(receiver); } }; var inherits = function(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; var possibleConstructorReturn = function(self2, call) { if (!self2) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self2; }; var slicedToArray = function() { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = void 0; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var Handle = ( /** * Creates a new Handle instance. * @constructor * @param {Array} position The x and y ratio position of the handle * within the crop region. Accepts a value between 0 to 1 in the order * of [X, Y]. * @param {Array} constraints Define the side of the crop region that * is to be affected by this handle. Accepts a value of 0 or 1 in the * order of [TOP, RIGHT, BOTTOM, LEFT]. * @param {String} cursor The CSS cursor of this handle. * @param {Element} eventBus The element to dispatch events to. */ function Handle2(position, constraints, cursor, eventBus) { classCallCheck(this, Handle2); var self2 = this; this.position = position; this.constraints = constraints; this.cursor = cursor; this.eventBus = eventBus; this.el = document.createElement("div"); this.el.className = "croppr-handle"; this.el.style.cursor = cursor; this.el.addEventListener("mousedown", onMouseDown); function onMouseDown(e) { e.stopPropagation(); document.addEventListener("mouseup", onMouseUp); document.addEventListener("mousemove", onMouseMove); self2.eventBus.dispatchEvent(new CustomEvent("handlestart", { detail: { handle: self2 } })); } function onMouseUp(e) { e.stopPropagation(); document.removeEventListener("mouseup", onMouseUp); document.removeEventListener("mousemove", onMouseMove); self2.eventBus.dispatchEvent(new CustomEvent("handleend", { detail: { handle: self2 } })); } function onMouseMove(e) { e.stopPropagation(); self2.eventBus.dispatchEvent(new CustomEvent("handlemove", { detail: { mouseX: e.clientX, mouseY: e.clientY } })); } } ); var Box = function() { function Box2(x1, y1, x2, y2) { classCallCheck(this, Box2); this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } createClass(Box2, [{ key: "set", value: function set$$1() { var x1 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; var y1 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; var x2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; var y2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; this.x1 = x1 == null ? this.x1 : x1; this.y1 = y1 == null ? this.y1 : y1; this.x2 = x2 == null ? this.x2 : x2; this.y2 = y2 == null ? this.y2 : y2; return this; } /** * Calculates the width of the box. * @returns {Number} */ }, { key: "width", value: function width() { return Math.abs(this.x2 - this.x1); } /** * Calculates the height of the box. * @returns {Number} */ }, { key: "height", value: function height() { return Math.abs(this.y2 - this.y1); } /** * Resizes the box to a new size. * @param {Number} newWidth * @param {Number} newHeight * @param {Array} [origin] The origin point to resize from. * Defaults to [0, 0] (top left). */ }, { key: "resize", value: function resize(newWidth, newHeight) { var origin = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [0, 0]; var fromX = this.x1 + this.width() * origin[0]; var fromY = this.y1 + this.height() * origin[1]; this.x1 = fromX - newWidth * origin[0]; this.y1 = fromY - newHeight * origin[1]; this.x2 = this.x1 + newWidth; this.y2 = this.y1 + newHeight; return this; } /** * Scale the box by a factor. * @param {Number} factor * @param {Array} [origin] The origin point to resize from. * Defaults to [0, 0] (top left). */ }, { key: "scale", value: function scale(factor) { var origin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0, 0]; var newWidth = this.width() * factor; var newHeight = this.height() * factor; this.resize(newWidth, newHeight, origin); return this; } }, { key: "move", value: function move() { var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; var width = this.width(); var height = this.height(); x = x === null ? this.x1 : x; y = y === null ? this.y1 : y; this.x1 = x; this.y1 = y; this.x2 = x + width; this.y2 = y + height; return this; } /** * Get relative x and y coordinates of a given point within the box. * @param {Array} point The x and y ratio position within the box. * @returns {Array} The x and y coordinates [x, y]. */ }, { key: "getRelativePoint", value: function getRelativePoint() { var point = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [0, 0]; var x = this.width() * point[0]; var y = this.height() * point[1]; return [x, y]; } /** * Get absolute x and y coordinates of a given point within the box. * @param {Array} point The x and y ratio position within the box. * @returns {Array} The x and y coordinates [x, y]. */ }, { key: "getAbsolutePoint", value: function getAbsolutePoint() { var point = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [0, 0]; var x = this.x1 + this.width() * point[0]; var y = this.y1 + this.height() * point[1]; return [x, y]; } /** * Constrain the box to a fixed ratio. * @param {Number} ratio * @param {Array} [origin] The origin point to resize from. * Defaults to [0, 0] (top left). * @param {String} [grow] The axis to grow to maintain the ratio. * Defaults to 'height'. */ }, { key: "constrainToRatio", value: function constrainToRatio(ratio) { var origin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0, 0]; var grow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "height"; if (ratio === null) { return; } var width = this.width(); var height = this.height(); switch (grow) { case "height": this.resize(this.width(), this.width() * ratio, origin); break; case "width": this.resize(this.height() * 1 / ratio, this.height(), origin); break; default: this.resize(this.width(), this.width() * ratio, origin); } return this; } /** * Constrain the box within a boundary. * @param {Number} boundaryWidth * @param {Number} boundaryHeight * @param {Array} [origin] The origin point to resize from. * Defaults to [0, 0] (top left). */ }, { key: "constrainToBoundary", value: function constrainToBoundary(boundaryWidth, boundaryHeight) { var origin = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [0, 0]; var _getAbsolutePoint = this.getAbsolutePoint(origin), _getAbsolutePoint2 = slicedToArray(_getAbsolutePoint, 2), originX = _getAbsolutePoint2[0], originY = _getAbsolutePoint2[1]; var maxIfLeft = originX; var maxIfTop = originY; var maxIfRight = boundaryWidth - originX; var maxIfBottom = boundaryHeight - originY; var directionX = -2 * origin[0] + 1; var directionY = -2 * origin[1] + 1; var maxWidth = null, maxHeight = null; switch (directionX) { case -1: maxWidth = maxIfLeft; break; case 0: maxWidth = Math.min(maxIfLeft, maxIfRight) * 2; break; case 1: maxWidth = maxIfRight; break; } switch (directionY) { case -1: maxHeight = maxIfTop; break; case 0: maxHeight = Math.min(maxIfTop, maxIfBottom) * 2; break; case 1: maxHeight = maxIfBottom; break; } if (this.width() > maxWidth) { var factor = maxWidth / this.width(); this.scale(factor, origin); } if (this.height() > maxHeight) { var _factor = maxHeight / this.height(); this.scale(_factor, origin); } return this; } /** * Constrain the box to a maximum/minimum size. * @param {Number} [maxWidth] * @param {Number} [maxHeight] * @param {Number} [minWidth] * @param {Number} [minHeight] * @param {Array} [origin] The origin point to resize from. * Defaults to [0, 0] (top left). * @param {Number} [ratio] Ratio to maintain. */ }, { key: "constrainToSize", value: function constrainToSize() { var maxWidth = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; var maxHeight = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; var minWidth = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; var minHeight = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; var origin = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : [0, 0]; var ratio = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : null; if (ratio) { if (ratio > 1) { maxWidth = maxHeight * 1 / ratio; minHeight = minHeight * ratio; } else if (ratio < 1) { maxHeight = maxWidth * ratio; minWidth = minHeight * 1 / ratio; } } if (maxWidth && this.width() > maxWidth) { var newWidth = maxWidth, newHeight = ratio === null ? this.height() : maxHeight; this.resize(newWidth, newHeight, origin); } if (maxHeight && this.height() > maxHeight) { var _newWidth = ratio === null ? this.width() : maxWidth, _newHeight = maxHeight; this.resize(_newWidth, _newHeight, origin); } if (minWidth && this.width() < minWidth) { var _newWidth2 = minWidth, _newHeight2 = ratio === null ? this.height() : minHeight; this.resize(_newWidth2, _newHeight2, origin); } if (minHeight && this.height() < minHeight) { var _newWidth3 = ratio === null ? this.width() : minWidth, _newHeight3 = minHeight; this.resize(_newWidth3, _newHeight3, origin); } return this; } }]); return Box2; }(); function enableTouch(element) { element.addEventListener("touchstart", simulateMouseEvent); element.addEventListener("touchend", simulateMouseEvent); element.addEventListener("touchmove", simulateMouseEvent); } function simulateMouseEvent(e) { e.preventDefault(); var touch = e.changedTouches[0]; var eventMap = { "touchstart": "mousedown", "touchmove": "mousemove", "touchend": "mouseup" }; touch.target.dispatchEvent(new MouseEvent(eventMap[e.type], { bubbles: true, cancelable: true, view: window, clientX: touch.clientX, clientY: touch.clientY, screenX: touch.screenX, screenY: touch.screenY })); } var HANDLES = [{ position: [0, 0], constraints: [1, 0, 0, 1], cursor: "nw-resize" }, { position: [0.5, 0], constraints: [1, 0, 0, 0], cursor: "n-resize" }, { position: [1, 0], constraints: [1, 1, 0, 0], cursor: "ne-resize" }, { position: [1, 0.5], constraints: [0, 1, 0, 0], cursor: "e-resize" }, { position: [1, 1], constraints: [0, 1, 1, 0], cursor: "se-resize" }, { position: [0.5, 1], constraints: [0, 0, 1, 0], cursor: "s-resize" }, { position: [0, 1], constraints: [0, 0, 1, 1], cursor: "sw-resize" }, { position: [0, 0.5], constraints: [0, 0, 0, 1], cursor: "w-resize" }]; var CropprCore = function() { function CropprCore2(element, options) { var _this = this; var deferred = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false; classCallCheck(this, CropprCore2); this.options = CropprCore2.parseOptions(options || {}); if (!element.nodeName) { element = document.querySelector(element); if (element == null) { throw "Unable to find element."; } } if (!element.getAttribute("src")) { throw "Image src not provided."; } this._initialized = false; this._restore = { parent: element.parentNode, element }; if (!deferred) { if (element.width === 0 || element.height === 0) { element.onload = function() { _this.initialize(element); }; } else { this.initialize(element); } } } createClass(CropprCore2, [{ key: "initialize", value: function initialize(element) { this.createDOM(element); this.options.convertToPixels(this.cropperEl); this.attachHandlerEvents(); this.attachRegionEvents(); this.attachOverlayEvents(); this.box = this.initializeBox(this.options); this.redraw(); this._initialized = true; if (this.options.onInitialize !== null) { this.options.onInitialize(this); } } }, { key: "createDOM", value: function createDOM(targetEl) { this.containerEl = document.createElement("div"); this.containerEl.className = "croppr-container"; this.eventBus = this.containerEl; enableTouch(this.containerEl); this.cropperEl = document.createElement("div"); this.cropperEl.className = "croppr"; this.imageEl = document.createElement("img"); this.imageEl.setAttribute("src", targetEl.getAttribute("src")); this.imageEl.setAttribute("alt", targetEl.getAttribute("alt")); this.imageEl.className = "croppr-image"; this.imageClippedEl = this.imageEl.cloneNode(); this.imageClippedEl.className = "croppr-imageClipped"; this.regionEl = document.createElement("div"); this.regionEl.className = "croppr-region"; this.overlayEl = document.createElement("div"); this.overlayEl.className = "croppr-overlay"; var handleContainerEl = document.createElement("div"); handleContainerEl.className = "croppr-handleContainer"; this.handles = []; for (var i = 0; i < HANDLES.length; i++) { var handle = new Handle(HANDLES[i].position, HANDLES[i].constraints, HANDLES[i].cursor, this.eventBus); this.handles.push(handle); handleContainerEl.appendChild(handle.el); } this.cropperEl.appendChild(this.imageEl); this.cropperEl.appendChild(this.imageClippedEl); this.cropperEl.appendChild(this.regionEl); this.cropperEl.appendChild(this.overlayEl); this.cropperEl.appendChild(handleContainerEl); this.containerEl.appendChild(this.cropperEl); targetEl.parentElement.replaceChild(this.containerEl, targetEl); } /** * Changes the image src. * @param {String} src */ }, { key: "setImage", value: function setImage(src) { var _this2 = this; this.imageEl.onload = function() { _this2.box = _this2.initializeBox(_this2.options); _this2.redraw(); }; this.imageEl.src = src; this.imageClippedEl.src = src; return this; } }, { key: "destroy", value: function destroy2() { this._restore.parent.replaceChild(this._restore.element, this.containerEl); } /** * Create a new box region with a set of options. * @param {Object} opts The options. * @returns {Box} */ }, { key: "initializeBox", value: function initializeBox(opts) { var width = opts.startSize.width; var height = opts.startSize.height; var box = new Box(0, 0, width, height); box.constrainToRatio(opts.aspectRatio, [0.5, 0.5]); var min2 = opts.minSize; var max2 = opts.maxSize; box.constrainToSize(max2.width, max2.height, min2.width, min2.height, [0.5, 0.5], opts.aspectRatio); var parentWidth = this.cropperEl.offsetWidth; var parentHeight = this.cropperEl.offsetHeight; box.constrainToBoundary(parentWidth, parentHeight, [0.5, 0.5]); var x = this.cropperEl.offsetWidth / 2 - box.width() / 2; var y = this.cropperEl.offsetHeight / 2 - box.height() / 2; box.move(x, y); return box; } }, { key: "redraw", value: function redraw() { var _this3 = this; var width = Math.round(this.box.width()), height = Math.round(this.box.height()), x1 = Math.round(this.box.x1), y1 = Math.round(this.box.y1), x2 = Math.round(this.box.x2), y2 = Math.round(this.box.y2); window.requestAnimationFrame(function() { _this3.regionEl.style.transform = "translate(" + x1 + "px, " + y1 + "px)"; _this3.regionEl.style.width = width + "px"; _this3.regionEl.style.height = height + "px"; _this3.imageClippedEl.style.clip = "rect(" + y1 + "px, " + x2 + "px, " + y2 + "px, " + x1 + "px)"; var center = _this3.box.getAbsolutePoint([0.5, 0.5]); var xSign = center[0] - _this3.cropperEl.offsetWidth / 2 >> 31; var ySign = center[1] - _this3.cropperEl.offsetHeight / 2 >> 31; var quadrant = (xSign ^ ySign) + ySign + ySign + 4; var foregroundHandleIndex = -2 * quadrant + 8; for (var i = 0; i < _this3.handles.length; i++) { var handle = _this3.handles[i]; var handleWidth = handle.el.offsetWidth; var handleHeight = handle.el.offsetHeight; var left2 = x1 + width * handle.position[0] - handleWidth / 2; var top2 = y1 + height * handle.position[1] - handleHeight / 2; handle.el.style.transform = "translate(" + Math.round(left2) + "px, " + Math.round(top2) + "px)"; handle.el.style.zIndex = foregroundHandleIndex == i ? 5 : 4; } }); } }, { key: "attachHandlerEvents", value: function attachHandlerEvents() { var eventBus = this.eventBus; eventBus.addEventListener("handlestart", this.onHandleMoveStart.bind(this)); eventBus.addEventListener("handlemove", this.onHandleMoveMoving.bind(this)); eventBus.addEventListener("handleend", this.onHandleMoveEnd.bind(this)); } }, { key: "attachRegionEvents", value: function attachRegionEvents() { var eventBus = this.eventBus; var self2 = this; this.regionEl.addEventListener("mousedown", onMouseDown); eventBus.addEventListener("regionstart", this.onRegionMoveStart.bind(this)); eventBus.addEventListener("regionmove", this.onRegionMoveMoving.bind(this)); eventBus.addEventListener("regionend", this.onRegionMoveEnd.bind(this)); function onMouseDown(e) { e.stopPropagation(); document.addEventListener("mouseup", onMouseUp); document.addEventListener("mousemove", onMouseMove); eventBus.dispatchEvent(new CustomEvent("regionstart", { detail: { mouseX: e.clientX, mouseY: e.clientY } })); } function onMouseMove(e) { e.stopPropagation(); eventBus.dispatchEvent(new CustomEvent("regionmove", { detail: { mouseX: e.clientX, mouseY: e.clientY } })); } function onMouseUp(e) { e.stopPropagation(); document.removeEventListener("mouseup", onMouseUp); document.removeEventListener("mousemove", onMouseMove); eventBus.dispatchEvent(new CustomEvent("regionend", { detail: { mouseX: e.clientX, mouseY: e.clientY } })); } } }, { key: "attachOverlayEvents", value: function attachOverlayEvents() { var SOUTHEAST_HANDLE_IDX = 4; var self2 = this; var tmpBox = null; this.overlayEl.addEventListener("mousedown", onMouseDown); function onMouseDown(e) { e.stopPropagation(); document.addEventListener("mouseup", onMouseUp); document.addEventListener("mousemove", onMouseMove); var container = self2.cropperEl.getBoundingClientRect(); var mouseX = e.clientX - container.left; var mouseY = e.clientY - container.top; tmpBox = self2.box; self2.box = new Box(mouseX, mouseY, mouseX + 1, mouseY + 1); self2.eventBus.dispatchEvent(new CustomEvent("handlestart", { detail: { handle: self2.handles[SOUTHEAST_HANDLE_IDX] } })); } function onMouseMove(e) { e.stopPropagation(); self2.eventBus.dispatchEvent(new CustomEvent("handlemove", { detail: { mouseX: e.clientX, mouseY: e.clientY } })); } function onMouseUp(e) { e.stopPropagation(); document.removeEventListener("mouseup", onMouseUp); document.removeEventListener("mousemove", onMouseMove); if (self2.box.width() === 1 && self2.box.height() === 1) { self2.box = tmpBox; return; } self2.eventBus.dispatchEvent(new CustomEvent("handleend", { detail: { mouseX: e.clientX, mouseY: e.clientY } })); } } }, { key: "onHandleMoveStart", value: function onHandleMoveStart(e) { var handle = e.detail.handle; var originPoint = [1 - handle.position[0], 1 - handle.position[1]]; var _box$getAbsolutePoint = this.box.getAbsolutePoint(originPoint), _box$getAbsolutePoint2 = slicedToArray(_box$getAbsolutePoint, 2), originX = _box$getAbsolutePoint2[0], originY = _box$getAbsolutePoint2[1]; this.activeHandle = { handle, originPoint, originX, originY }; if (this.options.onCropStart !== null) { this.options.onCropStart(this.getValue()); } } }, { key: "onHandleMoveMoving", value: function onHandleMoveMoving(e) { var _e$detail = e.detail, mouseX = _e$detail.mouseX, mouseY = _e$detail.mouseY; var container = this.cropperEl.getBoundingClientRect(); mouseX = mouseX - container.left; mouseY = mouseY - container.top; if (mouseX < 0) { mouseX = 0; } else if (mouseX > container.width) { mouseX = container.width; } if (mouseY < 0) { mouseY = 0; } else if (mouseY > container.height) { mouseY = container.height; } var origin = this.activeHandle.originPoint.slice(); var originX = this.activeHandle.originX; var originY = this.activeHandle.originY; var handle = this.activeHandle.handle; var TOP_MOVABLE = handle.constraints[0] === 1; var RIGHT_MOVABLE = handle.constraints[1] === 1; var BOTTOM_MOVABLE = handle.constraints[2] === 1; var LEFT_MOVABLE = handle.constraints[3] === 1; var MULTI_AXIS = (LEFT_MOVABLE || RIGHT_MOVABLE) && (TOP_MOVABLE || BOTTOM_MOVABLE); var x1 = LEFT_MOVABLE || RIGHT_MOVABLE ? originX : this.box.x1; var x2 = LEFT_MOVABLE || RIGHT_MOVABLE ? originX : this.box.x2; var y1 = TOP_MOVABLE || BOTTOM_MOVABLE ? originY : this.box.y1; var y2 = TOP_MOVABLE || BOTTOM_MOVABLE ? originY : this.box.y2; x1 = LEFT_MOVABLE ? mouseX : x1; x2 = RIGHT_MOVABLE ? mouseX : x2; y1 = TOP_MOVABLE ? mouseY : y1; y2 = BOTTOM_MOVABLE ? mouseY : y2; var isFlippedX = false, isFlippedY = false; if (LEFT_MOVABLE || RIGHT_MOVABLE) { isFlippedX = LEFT_MOVABLE ? mouseX > originX : mouseX < originX; } if (TOP_MOVABLE || BOTTOM_MOVABLE) { isFlippedY = TOP_MOVABLE ? mouseY > originY : mouseY < originY; } if (isFlippedX) { var tmp = x1; x1 = x2; x2 = tmp; origin[0] = 1 - origin[0]; } if (isFlippedY) { var _tmp = y1; y1 = y2; y2 = _tmp; origin[1] = 1 - origin[1]; } var box = new Box(x1, y1, x2, y2); if (this.options.aspectRatio) { var ratio = this.options.aspectRatio; var isVerticalMovement = false; if (MULTI_AXIS) { isVerticalMovement = mouseY > box.y1 + ratio * box.width() || mouseY < box.y2 - ratio * box.width(); } else if (TOP_MOVABLE || BOTTOM_MOVABLE) { isVerticalMovement = true; } var ratioMode = isVerticalMovement ? "width" : "height"; box.constrainToRatio(ratio, origin, ratioMode); } var min2 = this.options.minSize; var max2 = this.options.maxSize; box.constrainToSize(max2.width, max2.height, min2.width, min2.height, origin, this.options.aspectRatio); var parentWidth = this.cropperEl.offsetWidth; var parentHeight = this.cropperEl.offsetHeight; box.constrainToBoundary(parentWidth, parentHeight, origin); this.box = box; this.redraw(); if (this.options.onCropMove !== null) { this.options.onCropMove(this.getValue()); } } }, { key: "onHandleMoveEnd", value: function onHandleMoveEnd(e) { if (this.options.onCropEnd !== null) { this.options.onCropEnd(this.getValue()); } } }, { key: "onRegionMoveStart", value: function onRegionMoveStart(e) { var _e$detail2 = e.detail, mouseX = _e$detail2.mouseX, mouseY = _e$detail2.mouseY; var container = this.cropperEl.getBoundingClientRect(); mouseX = mouseX - container.left; mouseY = mouseY - container.top; this.currentMove = { offsetX: mouseX - this.box.x1, offsetY: mouseY - this.box.y1 }; if (this.options.onCropStart !== null) { this.options.onCropStart(this.getValue()); } } }, { key: "onRegionMoveMoving", value: function onRegionMoveMoving(e) { var _e$detail3 = e.detail, mouseX = _e$detail3.mouseX, mouseY = _e$detail3.mouseY; var _currentMove = this.currentMove, offsetX = _currentMove.offsetX, offsetY = _currentMove.offsetY; var container = this.cropperEl.getBoundingClientRect(); mouseX = mouseX - container.left; mouseY = mouseY - container.top; this.box.move(mouseX - offsetX, mouseY - offsetY); if (this.box.x1 < 0) { this.box.move(0, null); } if (this.box.x2 > container.width) { this.box.move(container.width - this.box.width(), null); } if (this.box.y1 < 0) { this.box.move(null, 0); } if (this.box.y2 > container.height) { this.box.move(null, container.height - this.box.height()); } this.redraw(); if (this.options.onCropMove !== null) { this.options.onCropMove(this.getValue()); } } }, { key: "onRegionMoveEnd", value: function onRegionMoveEnd(e) { if (this.options.onCropEnd !== null) { this.options.onCropEnd(this.getValue()); } } }, { key: "getValue", value: function getValue() { var mode = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; if (mode === null) { mode = this.options.returnMode; } if (mode == "real") { var actualWidth = this.imageEl.naturalWidth; var actualHeight = this.imageEl.naturalHeight; var _imageEl$getBoundingC = this.imageEl.getBoundingClientRect(), elementWidth = _imageEl$getBoundingC.width, elementHeight = _imageEl$getBoundingC.height; var factorX = actualWidth / elementWidth; var factorY = actualHeight / elementHeight; return { x: Math.round(this.box.x1 * factorX), y: Math.round(this.box.y1 * factorY), width: Math.round(this.box.width() * factorX), height: Math.round(this.box.height() * factorY) }; } else if (mode == "ratio") { var _imageEl$getBoundingC2 = this.imageEl.getBoundingClientRect(), _elementWidth = _imageEl$getBoundingC2.width, _elementHeight = _imageEl$getBoundingC2.height; return { x: round2(this.box.x1 / _elementWidth, 3), y: round2(this.box.y1 / _elementHeight, 3), width: round2(this.box.width() / _elementWidth, 3), height: round2(this.box.height() / _elementHeight, 3) }; } else if (mode == "raw") { return { x: Math.round(this.box.x1), y: Math.round(this.box.y1), width: Math.round(this.box.width()), height: Math.round(this.box.height()) }; } } }], [{ key: "parseOptions", value: function parseOptions(opts) { var defaults$$1 = { aspectRatio: null, maxSize: { width: null, height: null }, minSize: { width: null, height: null }, startSize: { width: 100, height: 100, unit: "%" }, returnMode: "real", onInitialize: null, onCropStart: null, onCropMove: null, onCropEnd: null }; var aspectRatio = null; if (opts.aspectRatio !== void 0) { if (typeof opts.aspectRatio === "number") { aspectRatio = opts.aspectRatio; } else if (opts.aspectRatio instanceof Array) { aspectRatio = opts.aspectRatio[1] / opts.aspectRatio[0]; } } var maxSize = null; if (opts.maxSize !== void 0 && opts.maxSize !== null) { maxSize = { width: opts.maxSize[0] || null, height: opts.maxSize[1] || null, unit: opts.maxSize[2] || "px" }; } var minSize = null; if (opts.minSize !== void 0 && opts.minSize !== null) { minSize = { width: opts.minSize[0] || null, height: opts.minSize[1] || null, unit: opts.minSize[2] || "px" }; } var startSize = null; if (opts.startSize !== void 0 && opts.startSize !== null) { startSize = { width: opts.startSize[0] || null, height: opts.startSize[1] || null, unit: opts.startSize[2] || "%" }; } var onInitialize = null; if (typeof opts.onInitialize === "function") { onInitialize = opts.onInitialize; } var onCropStart = null; if (typeof opts.onCropStart === "function") { onCropStart = opts.onCropStart; } var onCropEnd = null; if (typeof opts.onCropEnd === "function") { onCropEnd = opts.onCropEnd; } var onCropMove = null; if (typeof opts.onUpdate === "function") { console.warn("Croppr.js: `onUpdate` is deprecated and will be removed in the next major release. Please use `onCropMove` or `onCropEnd` instead."); onCropMove = opts.onUpdate; } if (typeof opts.onCropMove === "function") { onCropMove = opts.onCropMove; } var returnMode = null; if (opts.returnMode !== void 0) { var s = opts.returnMode.toLowerCase(); if (["real", "ratio", "raw"].indexOf(s) === -1) { throw "Invalid return mode."; } returnMode = s; } var convertToPixels = function convertToPixels2(container) { var width = container.offsetWidth; var height = container.offsetHeight; var sizeKeys = ["maxSize", "minSize", "startSize"]; for (var i = 0; i < sizeKeys.length; i++) { var key = sizeKeys[i]; if (this[key] !== null) { if (this[key].unit == "%") { if (this[key].width !== null) { this[key].width = this[key].width / 100 * width; } if (this[key].height !== null) { this[key].height = this[key].height / 100 * height; } } delete this[key].unit; } } }; var defaultValue = function defaultValue2(v, d) { return v !== null ? v : d; }; return { aspectRatio: defaultValue(aspectRatio, defaults$$1.aspectRatio), maxSize: defaultValue(maxSize, defaults$$1.maxSize), minSize: defaultValue(minSize, defaults$$1.minSize), startSize: defaultValue(startSize, defaults$$1.startSize), returnMode: defaultValue(returnMode, defaults$$1.returnMode), onInitialize: defaultValue(onInitialize, defaults$$1.onInitialize), onCropStart: defaultValue(onCropStart, defaults$$1.onCropStart), onCropMove: defaultValue(onCropMove, defaults$$1.onCropMove), onCropEnd: defaultValue(onCropEnd, defaults$$1.onCropEnd), convertToPixels }; } }]); return CropprCore2; }(); function round2(value, decimals) { return Number(Math.round(value + "e" + decimals) + "e-" + decimals); } var Croppr$1 = function(_CropprCore) { inherits(Croppr2, _CropprCore); function Croppr2(element, options) { var _deferred = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false; classCallCheck(this, Croppr2); return possibleConstructorReturn(this, (Croppr2.__proto__ || Object.getPrototypeOf(Croppr2)).call(this, element, options, _deferred)); } createClass(Croppr2, [{ key: "getValue", value: function getValue(mode) { return get4(Croppr2.prototype.__proto__ || Object.getPrototypeOf(Croppr2.prototype), "getValue", this).call(this, mode); } /** * Changes the image src. * @param {String} src */ }, { key: "setImage", value: function setImage(src) { return get4(Croppr2.prototype.__proto__ || Object.getPrototypeOf(Croppr2.prototype), "setImage", this).call(this, src); } }, { key: "destroy", value: function destroy2() { return get4(Croppr2.prototype.__proto__ || Object.getPrototypeOf(Croppr2.prototype), "destroy", this).call(this); } /** * Moves the crop region to a specified coordinate. * @param {Number} x * @param {Number} y */ }, { key: "moveTo", value: function moveTo(x, y) { this.box.move(x, y); this.redraw(); if (this.options.onCropEnd !== null) { this.options.onCropEnd(this.getValue()); } return this; } /** * Resizes the crop region to a specified width and height. * @param {Number} width * @param {Number} height * @param {Array} origin The origin point to resize from. * Defaults to [0.5, 0.5] (center). */ }, { key: "resizeTo", value: function resizeTo(width, height) { var origin = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [0.5, 0.5]; this.box.resize(width, height, origin); this.redraw(); if (this.options.onCropEnd !== null) { this.options.onCropEnd(this.getValue()); } return this; } /** * Scale the crop region by a factor. * @param {Number} factor * @param {Array} origin The origin point to resize from. * Defaults to [0.5, 0.5] (center). */ }, { key: "scaleBy", value: function scaleBy(factor) { var origin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0.5, 0.5]; this.box.scale(factor, origin); this.redraw(); if (this.options.onCropEnd !== null) { this.options.onCropEnd(this.getValue()); } return this; } }, { key: "reset", value: function reset() { this.box = this.initializeBox(this.options); this.redraw(); if (this.options.onCropEnd !== null) { this.options.onCropEnd(this.getValue()); } return this; } }]); return Croppr2; }(CropprCore); return Croppr$1; }); } }); // node_modules/toastify-js/src/toastify.js var require_toastify = __commonJS({ "node_modules/toastify-js/src/toastify.js"(exports, module) { (function(root, factory) { if (typeof module === "object" && module.exports) { module.exports = factory(); } else { root.Toastify = factory(); } })(exports, function(global2) { var Toastify2 = function(options) { return new Toastify2.lib.init(options); }, version = "1.12.0"; Toastify2.defaults = { oldestFirst: true, text: "Toastify is awesome!", node: void 0, duration: 3e3, selector: void 0, callback: function() { }, destination: void 0, newWindow: false, close: false, gravity: "toastify-top", positionLeft: false, position: "", backgroundColor: "", avatar: "", className: "", stopOnFocus: true, onClick: function() { }, offset: { x: 0, y: 0 }, escapeMarkup: true, ariaLive: "polite", style: { background: "" } }; Toastify2.lib = Toastify2.prototype = { toastify: version, constructor: Toastify2, // Initializing the object with required parameters init: function(options) { if (!options) { options = {}; } this.options = {}; this.toastElement = null; this.options.text = options.text || Toastify2.defaults.text; this.options.node = options.node || Toastify2.defaults.node; this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify2.defaults.duration; this.options.selector = options.selector || Toastify2.defaults.selector; this.options.callback = options.callback || Toastify2.defaults.callback; this.options.destination = options.destination || Toastify2.defaults.destination; this.options.newWindow = options.newWindow || Toastify2.defaults.newWindow; this.options.close = options.close || Toastify2.defaults.close; this.options.gravity = options.gravity === "bottom" ? "toastify-bottom" : Toastify2.defaults.gravity; this.options.positionLeft = options.positionLeft || Toastify2.defaults.positionLeft; this.options.position = options.position || Toastify2.defaults.position; this.options.backgroundColor = options.backgroundColor || Toastify2.defaults.backgroundColor; this.options.avatar = options.avatar || Toastify2.defaults.avatar; this.options.className = options.className || Toastify2.defaults.className; this.options.stopOnFocus = options.stopOnFocus === void 0 ? Toastify2.defaults.stopOnFocus : options.stopOnFocus; this.options.onClick = options.onClick || Toastify2.defaults.onClick; this.options.offset = options.offset || Toastify2.defaults.offset; this.options.escapeMarkup = options.escapeMarkup !== void 0 ? options.escapeMarkup : Toastify2.defaults.escapeMarkup; this.options.ariaLive = options.ariaLive || Toastify2.defaults.ariaLive; this.options.style = options.style || Toastify2.defaults.style; if (options.backgroundColor) { this.options.style.background = options.backgroundColor; } return this; }, // Building the DOM element buildToast: function() { if (!this.options) { throw "Toastify is not initialized"; } var divElement = document.createElement("div"); divElement.className = "toastify on " + this.options.className; if (!!this.options.position) { divElement.className += " toastify-" + this.options.position; } else { if (this.options.positionLeft === true) { divElement.className += " toastify-left"; console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead."); } else { divElement.className += " toastify-right"; } } divElement.className += " " + this.options.gravity; if (this.options.backgroundColor) { console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.'); } for (var property in this.options.style) { divElement.style[property] = this.options.style[property]; } if (this.options.ariaLive) { divElement.setAttribute("aria-live", this.options.ariaLive); } if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) { divElement.appendChild(this.options.node); } else { if (this.options.escapeMarkup) { divElement.innerText = this.options.text; } else { divElement.innerHTML = this.options.text; } if (this.options.avatar !== "") { var avatarElement = document.createElement("img"); avatarElement.src = this.options.avatar; avatarElement.className = "toastify-avatar"; if (this.options.position == "left" || this.options.positionLeft === true) { divElement.appendChild(avatarElement); } else { divElement.insertAdjacentElement("afterbegin", avatarElement); } } } if (this.options.close === true) { var closeElement = document.createElement("button"); closeElement.type = "button"; closeElement.setAttribute("aria-label", "Close"); closeElement.className = "toast-close"; closeElement.innerHTML = "✖"; closeElement.addEventListener( "click", function(event2) { event2.stopPropagation(); this.removeElement(this.toastElement); window.clearTimeout(this.toastElement.timeOutValue); }.bind(this) ); var width = window.innerWidth > 0 ? window.innerWidth : screen.width; if ((this.options.position == "left" || this.options.positionLeft === true) && width > 360) { divElement.insertAdjacentElement("afterbegin", closeElement); } else { divElement.appendChild(closeElement); } } if (this.options.stopOnFocus && this.options.duration > 0) { var self2 = this; divElement.addEventListener( "mouseover", function(event2) { window.clearTimeout(divElement.timeOutValue); } ); divElement.addEventListener( "mouseleave", function() { divElement.timeOutValue = window.setTimeout( function() { self2.removeElement(divElement); }, self2.options.duration ); } ); } if (typeof this.options.destination !== "undefined") { divElement.addEventListener( "click", function(event2) { event2.stopPropagation(); if (this.options.newWindow === true) { window.open(this.options.destination, "_blank"); } else { window.location = this.options.destination; } }.bind(this) ); } if (typeof this.options.onClick === "function" && typeof this.options.destination === "undefined") { divElement.addEventListener( "click", function(event2) { event2.stopPropagation(); this.options.onClick(); }.bind(this) ); } if (typeof this.options.offset === "object") { var x = getAxisOffsetAValue("x", this.options); var y = getAxisOffsetAValue("y", this.options); var xOffset = this.options.position == "left" ? x : "-" + x; var yOffset = this.options.gravity == "toastify-top" ? y : "-" + y; divElement.style.transform = "translate(" + xOffset + "," + yOffset + ")"; } return divElement; }, // Displaying the toast showToast: function() { this.toastElement = this.buildToast(); var rootElement; if (typeof this.options.selector === "string") { rootElement = document.getElementById(this.options.selector); } else if (this.options.selector instanceof HTMLElement || typeof ShadowRoot !== "undefined" && this.options.selector instanceof ShadowRoot) { rootElement = this.options.selector; } else { rootElement = document.body; } if (!rootElement) { throw "Root element is not defined"; } var elementToInsert = Toastify2.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild; rootElement.insertBefore(this.toastElement, elementToInsert); Toastify2.reposition(); if (this.options.duration > 0) { this.toastElement.timeOutValue = window.setTimeout( function() { this.removeElement(this.toastElement); }.bind(this), this.options.duration ); } return this; }, hideToast: function() { if (this.toastElement.timeOutValue) { clearTimeout(this.toastElement.timeOutValue); } this.removeElement(this.toastElement); }, // Removing the element from the DOM removeElement: function(toastElement) { toastElement.className = toastElement.className.replace(" on", ""); window.setTimeout( function() { if (this.options.node && this.options.node.parentNode) { this.options.node.parentNode.removeChild(this.options.node); } if (toastElement.parentNode) { toastElement.parentNode.removeChild(toastElement); } this.options.callback.call(toastElement); Toastify2.reposition(); }.bind(this), 400 ); } }; Toastify2.reposition = function() { var topLeftOffsetSize = { top: 15, bottom: 15 }; var topRightOffsetSize = { top: 15, bottom: 15 }; var offsetSize = { top: 15, bottom: 15 }; var allToasts = document.getElementsByClassName("toastify"); var classUsed; for (var i = 0; i < allToasts.length; i++) { if (containsClass(allToasts[i], "toastify-top") === true) { classUsed = "toastify-top"; } else { classUsed = "toastify-bottom"; } var height = allToasts[i].offsetHeight; classUsed = classUsed.substr(9, classUsed.length - 1); var offset2 = 15; var width = window.innerWidth > 0 ? window.innerWidth : screen.width; if (width <= 360) { allToasts[i].style[classUsed] = offsetSize[classUsed] + "px"; offsetSize[classUsed] += height + offset2; } else { if (containsClass(allToasts[i], "toastify-left") === true) { allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + "px"; topLeftOffsetSize[classUsed] += height + offset2; } else { allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + "px"; topRightOffsetSize[classUsed] += height + offset2; } } } return this; }; function getAxisOffsetAValue(axis, options) { if (options.offset[axis]) { if (isNaN(options.offset[axis])) { return options.offset[axis]; } else { return options.offset[axis] + "px"; } } return "0px"; } function containsClass(elem, yourClass) { if (!elem || typeof yourClass !== "string") { return false; } else if (elem.className && elem.className.trim().split(/\s+/gi).indexOf(yourClass) > -1) { return true; } else { return false; } } Toastify2.lib.init.prototype = Toastify2.lib; return Toastify2; }); } }); // node_modules/js-cookie/src/js.cookie.js var require_js_cookie = __commonJS({ "node_modules/js-cookie/src/js.cookie.js"(exports, module) { (function(factory) { var registeredInModuleLoader; if (typeof define === "function" && define.amd) { define(factory); registeredInModuleLoader = true; } if (typeof exports === "object") { module.exports = factory(); registeredInModuleLoader = true; } if (!registeredInModuleLoader) { var OldCookies = window.Cookies; var api = window.Cookies = factory(); api.noConflict = function() { window.Cookies = OldCookies; return api; }; } })(function() { function extend3() { var i = 0; var result = {}; for (; i < arguments.length; i++) { var attributes = arguments[i]; for (var key in attributes) { result[key] = attributes[key]; } } return result; } function decode(s) { return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); } function init(converter) { function api() { } function set2(key, value, attributes) { if (typeof document === "undefined") { return; } attributes = extend3({ path: "/" }, api.defaults, attributes); if (typeof attributes.expires === "number") { attributes.expires = new Date(/* @__PURE__ */ new Date() * 1 + attributes.expires * 864e5); } attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ""; try { var result = JSON.stringify(value); if (/^[\{\[]/.test(result)) { value = result; } } catch (e) { } value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape); var stringifiedAttributes = ""; for (var attributeName in attributes) { if (!attributes[attributeName]) { continue; } stringifiedAttributes += "; " + attributeName; if (attributes[attributeName] === true) { continue; } stringifiedAttributes += "=" + attributes[attributeName].split(";")[0]; } return document.cookie = key + "=" + value + stringifiedAttributes; } function get4(key, json) { if (typeof document === "undefined") { return; } var jar = {}; var cookies = document.cookie ? document.cookie.split("; ") : []; var i = 0; for (; i < cookies.length; i++) { var parts = cookies[i].split("="); var cookie = parts.slice(1).join("="); if (!json && cookie.charAt(0) === '"') { cookie = cookie.slice(1, -1); } try { var name = decode(parts[0]); cookie = (converter.read || converter)(cookie, name) || decode(cookie); if (json) { try { cookie = JSON.parse(cookie); } catch (e) { } } jar[name] = cookie; if (key === name) { break; } } catch (e) { } } return key ? jar[key] : jar; } api.set = set2; api.get = function(key) { return get4( key, false /* read as raw */ ); }; api.getJSON = function(key) { return get4( key, true /* read as json */ ); }; api.remove = function(key, attributes) { set2(key, "", extend3(attributes, { expires: -1 })); }; api.defaults = {}; api.withConverter = init; return api; } return init(function() { }); }); } }); // node_modules/lodash/lodash.js var require_lodash = __commonJS({ "node_modules/lodash/lodash.js"(exports, module) { (function() { var undefined2; var VERSION2 = "4.17.21"; var LARGE_ARRAY_SIZE = 200; var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`"; var HASH_UNDEFINED = "__lodash_hash_undefined__"; var MAX_MEMOIZE_SIZE = 500; var PLACEHOLDER = "__lodash_placeholder__"; var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "..."; var HOT_COUNT = 800, HOT_SPAN = 16; var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0; var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; var wrapFlags = [ ["ary", WRAP_ARY_FLAG], ["bind", WRAP_BIND_FLAG], ["bindKey", WRAP_BIND_KEY_FLAG], ["curry", WRAP_CURRY_FLAG], ["curryRight", WRAP_CURRY_RIGHT_FLAG], ["flip", WRAP_FLIP_FLAG], ["partial", WRAP_PARTIAL_FLAG], ["partialRight", WRAP_PARTIAL_RIGHT_FLAG], ["rearg", WRAP_REARG_FLAG] ]; var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]"; var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); var reTrimStart = /^\s+/; var reWhitespace = /\s/; var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; var reEscapeChar = /\\(\\)?/g; var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; var reFlags = /\w*$/; var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; var reIsBinary = /^0b[01]+$/i; var reIsHostCtor = /^\[object .+?Constructor\]$/; var reIsOctal = /^0o[0-7]+$/i; var reIsUint = /^(?:0|[1-9]\d*)$/; var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; var reNoMatch = /($^)/; var reUnescapedString = /['\n\r\u2028\u2029\\]/g; var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; var reApos = RegExp(rsApos, "g"); var reComboMark = RegExp(rsCombo, "g"); var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); var reUnicodeWord = RegExp([ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")", rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, rsUpper + "+" + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join("|"), "g"); var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]"); var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; var contextProps = [ "Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout" ]; var templateCounter = -1; var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; var deburredLetters = { // Latin-1 Supplement block. "\xC0": "A", "\xC1": "A", "\xC2": "A", "\xC3": "A", "\xC4": "A", "\xC5": "A", "\xE0": "a", "\xE1": "a", "\xE2": "a", "\xE3": "a", "\xE4": "a", "\xE5": "a", "\xC7": "C", "\xE7": "c", "\xD0": "D", "\xF0": "d", "\xC8": "E", "\xC9": "E", "\xCA": "E", "\xCB": "E", "\xE8": "e", "\xE9": "e", "\xEA": "e", "\xEB": "e", "\xCC": "I", "\xCD": "I", "\xCE": "I", "\xCF": "I", "\xEC": "i", "\xED": "i", "\xEE": "i", "\xEF": "i", "\xD1": "N", "\xF1": "n", "\xD2": "O", "\xD3": "O", "\xD4": "O", "\xD5": "O", "\xD6": "O", "\xD8": "O", "\xF2": "o", "\xF3": "o", "\xF4": "o", "\xF5": "o", "\xF6": "o", "\xF8": "o", "\xD9": "U", "\xDA": "U", "\xDB": "U", "\xDC": "U", "\xF9": "u", "\xFA": "u", "\xFB": "u", "\xFC": "u", "\xDD": "Y", "\xFD": "y", "\xFF": "y", "\xC6": "Ae", "\xE6": "ae", "\xDE": "Th", "\xFE": "th", "\xDF": "ss", // Latin Extended-A block. "\u0100": "A", "\u0102": "A", "\u0104": "A", "\u0101": "a", "\u0103": "a", "\u0105": "a", "\u0106": "C", "\u0108": "C", "\u010A": "C", "\u010C": "C", "\u0107": "c", "\u0109": "c", "\u010B": "c", "\u010D": "c", "\u010E": "D", "\u0110": "D", "\u010F": "d", "\u0111": "d", "\u0112": "E", "\u0114": "E", "\u0116": "E", "\u0118": "E", "\u011A": "E", "\u0113": "e", "\u0115": "e", "\u0117": "e", "\u0119": "e", "\u011B": "e", "\u011C": "G", "\u011E": "G", "\u0120": "G", "\u0122": "G", "\u011D": "g", "\u011F": "g", "\u0121": "g", "\u0123": "g", "\u0124": "H", "\u0126": "H", "\u0125": "h", "\u0127": "h", "\u0128": "I", "\u012A": "I", "\u012C": "I", "\u012E": "I", "\u0130": "I", "\u0129": "i", "\u012B": "i", "\u012D": "i", "\u012F": "i", "\u0131": "i", "\u0134": "J", "\u0135": "j", "\u0136": "K", "\u0137": "k", "\u0138": "k", "\u0139": "L", "\u013B": "L", "\u013D": "L", "\u013F": "L", "\u0141": "L", "\u013A": "l", "\u013C": "l", "\u013E": "l", "\u0140": "l", "\u0142": "l", "\u0143": "N", "\u0145": "N", "\u0147": "N", "\u014A": "N", "\u0144": "n", "\u0146": "n", "\u0148": "n", "\u014B": "n", "\u014C": "O", "\u014E": "O", "\u0150": "O", "\u014D": "o", "\u014F": "o", "\u0151": "o", "\u0154": "R", "\u0156": "R", "\u0158": "R", "\u0155": "r", "\u0157": "r", "\u0159": "r", "\u015A": "S", "\u015C": "S", "\u015E": "S", "\u0160": "S", "\u015B": "s", "\u015D": "s", "\u015F": "s", "\u0161": "s", "\u0162": "T", "\u0164": "T", "\u0166": "T", "\u0163": "t", "\u0165": "t", "\u0167": "t", "\u0168": "U", "\u016A": "U", "\u016C": "U", "\u016E": "U", "\u0170": "U", "\u0172": "U", "\u0169": "u", "\u016B": "u", "\u016D": "u", "\u016F": "u", "\u0171": "u", "\u0173": "u", "\u0174": "W", "\u0175": "w", "\u0176": "Y", "\u0177": "y", "\u0178": "Y", "\u0179": "Z", "\u017B": "Z", "\u017D": "Z", "\u017A": "z", "\u017C": "z", "\u017E": "z", "\u0132": "IJ", "\u0133": "ij", "\u0152": "Oe", "\u0153": "oe", "\u0149": "'n", "\u017F": "s" }; var htmlEscapes = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }; var htmlUnescapes = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }; var stringEscapes = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }; var freeParseFloat = parseFloat, freeParseInt = parseInt; var freeGlobal = typeof global == "object" && global && global.Object === Object && global; var freeSelf = typeof self == "object" && self && self.Object === Object && self; var root = freeGlobal || freeSelf || Function("return this")(); var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; var moduleExports = freeModule && freeModule.exports === freeExports; var freeProcess = moduleExports && freeGlobal.process; var nodeUtil = function() { try { var types = freeModule && freeModule.require && freeModule.require("util").types; if (types) { return types; } return freeProcess && freeProcess.binding && freeProcess.binding("util"); } catch (e) { } }(); var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } function arrayEachRight(array, iteratee) { var length = array == null ? 0 : array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } function arrayEvery(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } function arrayPush(array, values) { var index = -1, length = values.length, offset2 = array.length; while (++index < length) { array[offset2 + index] = values[index]; } return array; } function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } var asciiSize = baseProperty("length"); function asciiToArray(string) { return string.split(""); } function asciiWords(string) { return string.match(reAsciiWord) || []; } function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key, collection2) { if (predicate(value, key, collection2)) { result = key; return false; } }); return result; } function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while (fromRight ? index-- : ++index < length) { if (predicate(array[index], index, array)) { return index; } } return -1; } function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (comparator(array[index], value)) { return index; } } return -1; } function baseIsNaN(value) { return value !== value; } function baseMean(array, iteratee) { var length = array == null ? 0 : array.length; return length ? baseSum(array, iteratee) / length : NAN; } function baseProperty(key) { return function(object) { return object == null ? undefined2 : object[key]; }; } function basePropertyOf(object) { return function(key) { return object == null ? undefined2 : object[key]; }; } function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection2) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2); }); return accumulator; } function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined2) { result = result === undefined2 ? current : result + current; } } return result; } function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } function baseToPairs(object, props) { return arrayMap(props, function(key) { return [key, object[key]]; }); } function baseTrim(string) { return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; } function baseUnary(func) { return function(value) { return func(value); }; } function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } function cacheHas(cache2, key) { return cache2.has(key); } function charsStartIndex(strSymbols, chrSymbols) { var index = -1, length = strSymbols.length; while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { } return index; } function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { } return index; } function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } var deburrLetter = basePropertyOf(deburredLetters); var escapeHtmlChar = basePropertyOf(htmlEscapes); function escapeStringChar(chr) { return "\\" + stringEscapes[chr]; } function getValue(object, key) { return object == null ? undefined2 : object[key]; } function hasUnicode(string) { return reHasUnicode.test(string); } function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } function iteratorToArray(iterator) { var data, result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } function setToArray(set2) { var index = -1, result = Array(set2.size); set2.forEach(function(value) { result[++index] = value; }); return result; } function setToPairs(set2) { var index = -1, result = Array(set2.size); set2.forEach(function(value) { result[++index] = [value, value]; }); return result; } function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } function strictLastIndexOf(array, value, fromIndex) { var index = fromIndex + 1; while (index--) { if (array[index] === value) { return index; } } return index; } function stringSize(string) { return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); } function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } function trimmedEndIndex(string) { var index = string.length; while (index-- && reWhitespace.test(string.charAt(index))) { } return index; } var unescapeHtmlChar = basePropertyOf(htmlUnescapes); function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { ++result; } return result; } function unicodeToArray(string) { return string.match(reUnicode) || []; } function unicodeWords(string) { return string.match(reUnicodeWord) || []; } var runInContext = function runInContext2(context) { context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError; var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype; var coreJsData = context["__core-js_shared__"]; var funcToString = funcProto.toString; var hasOwnProperty = objectProto.hasOwnProperty; var idCounter = 0; var maskSrcKey = function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); return uid ? "Symbol(src)_1." + uid : ""; }(); var nativeObjectToString = objectProto.toString; var objectCtorString = funcToString.call(Object2); var oldDash = root._; var reIsNative = RegExp2( "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); var Buffer3 = moduleExports ? context.Buffer : undefined2, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer3 ? Buffer3.allocUnsafe : undefined2, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined2, symIterator = Symbol2 ? Symbol2.iterator : undefined2, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined2; var defineProperty = function() { try { var func = getNative(Object2, "defineProperty"); func({}, "", {}); return func; } catch (e) { } }(); var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer3 ? Buffer3.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse; var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create"); var metaMap = WeakMap2 && new WeakMap2(); var realNames = {}; var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2); var symbolProto = Symbol2 ? Symbol2.prototype : undefined2, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined2, symbolToString = symbolProto ? symbolProto.toString : undefined2; function lodash(value) { if (isObjectLike(value) && !isArray2(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.call(value, "__wrapped__")) { return wrapperClone(value); } } return new LodashWrapper(value); } var baseCreate = function() { function object() { } return function(proto) { if (!isObject2(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result2 = new object(); object.prototype = undefined2; return result2; }; }(); function baseLodash() { } function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined2; } lodash.templateSettings = { /** * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings * @type {RegExp} */ "escape": reEscape, /** * Used to detect code to be evaluated. * * @memberOf _.templateSettings * @type {RegExp} */ "evaluate": reEvaluate, /** * Used to detect `data` property values to inject. * * @memberOf _.templateSettings * @type {RegExp} */ "interpolate": reInterpolate, /** * Used to reference the data object in the template text. * * @memberOf _.templateSettings * @type {string} */ "variable": "", /** * Used to import variables into the compiled template. * * @memberOf _.templateSettings * @type {Object} */ "imports": { /** * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports * @type {Function} */ "_": lodash } }; lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } function lazyClone() { var result2 = new LazyWrapper(this.__wrapped__); result2.__actions__ = copyArray(this.__actions__); result2.__dir__ = this.__dir__; result2.__filtered__ = this.__filtered__; result2.__iteratees__ = copyArray(this.__iteratees__); result2.__takeCount__ = this.__takeCount__; result2.__views__ = copyArray(this.__views__); return result2; } function lazyReverse() { if (this.__filtered__) { var result2 = new LazyWrapper(this); result2.__dir__ = -1; result2.__filtered__ = true; } else { result2 = this.clone(); result2.__dir__ *= -1; } return result2; } function lazyValue() { var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray2(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start4 = view.start, end2 = view.end, length = end2 - start4, index = isRight ? end2 : start4 - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); if (!isArr || !isRight && arrLength == length && takeCount == length) { return baseWrapperValue(array, this.__actions__); } var result2 = []; outer: while (length-- && resIndex < takeCount) { index += dir; var iterIndex = -1, value = array[index]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value); if (type == LAZY_MAP_FLAG) { value = computed; } else if (!computed) { if (type == LAZY_FILTER_FLAG) { continue outer; } else { break outer; } } } result2[resIndex++] = value; } return result2; } LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } function hashDelete(key) { var result2 = this.has(key) && delete this.__data__[key]; this.size -= result2 ? 1 : 0; return result2; } function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result2 = data[key]; return result2 === HASH_UNDEFINED ? undefined2 : result2; } return hasOwnProperty.call(data, key) ? data[key] : undefined2; } function hashHas(key) { var data = this.__data__; return nativeCreate ? data[key] !== undefined2 : hasOwnProperty.call(data, key); } function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = nativeCreate && value === undefined2 ? HASH_UNDEFINED : value; return this; } Hash.prototype.clear = hashClear; Hash.prototype["delete"] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } function listCacheClear() { this.__data__ = []; this.size = 0; } function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined2 : data[index][1]; } function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } ListCache.prototype.clear = listCacheClear; ListCache.prototype["delete"] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } function mapCacheClear() { this.size = 0; this.__data__ = { "hash": new Hash(), "map": new (Map2 || ListCache)(), "string": new Hash() }; } function mapCacheDelete(key) { var result2 = getMapData(this, key)["delete"](key); this.size -= result2 ? 1 : 0; return result2; } function mapCacheGet(key) { return getMapData(this, key).get(key); } function mapCacheHas(key) { return getMapData(this, key).has(key); } function mapCacheSet(key, value) { var data = getMapData(this, key), size2 = data.size; data.set(key, value); this.size += data.size == size2 ? 0 : 1; return this; } MapCache.prototype.clear = mapCacheClear; MapCache.prototype["delete"] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; function SetCache(values2) { var index = -1, length = values2 == null ? 0 : values2.length; this.__data__ = new MapCache(); while (++index < length) { this.add(values2[index]); } } function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } function setCacheHas(value) { return this.__data__.has(value); } SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } function stackClear() { this.__data__ = new ListCache(); this.size = 0; } function stackDelete(key) { var data = this.__data__, result2 = data["delete"](key); this.size = data.size; return result2; } function stackGet(key) { return this.__data__.get(key); } function stackHas(key) { return this.__data__.has(key); } function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } Stack.prototype.clear = stackClear; Stack.prototype["delete"] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; function arrayLikeKeys(value, inherited) { var isArr = isArray2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. isIndex(key, length)))) { result2.push(key); } } return result2; } function arraySample(array) { var length = array.length; return length ? array[baseRandom(0, length - 1)] : undefined2; } function arraySampleSize(array, n) { return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } function arrayShuffle(array) { return shuffleSelf(copyArray(array)); } function assignMergeValue(object, key, value) { if (value !== undefined2 && !eq(object[key], value) || value === undefined2 && !(key in object)) { baseAssignValue(object, key, value); } } function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined2 && !(key in object)) { baseAssignValue(object, key, value); } } function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } function baseAggregator(collection, setter, iteratee2, accumulator) { baseEach(collection, function(value, key, collection2) { setter(accumulator, value, iteratee2(value), collection2); }); return accumulator; } function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } function baseAssignValue(object, key, value) { if (key == "__proto__" && defineProperty) { defineProperty(object, key, { "configurable": true, "enumerable": true, "value": value, "writable": true }); } else { object[key] = value; } } function baseAt(object, paths) { var index = -1, length = paths.length, result2 = Array2(length), skip = object == null; while (++index < length) { result2[index] = skip ? undefined2 : get4(object, paths[index]); } return result2; } function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined2) { number = number <= upper ? number : upper; } if (lower !== undefined2) { number = number >= lower ? number : lower; } } return number; } function baseClone(value, bitmask, customizer, key, object, stack) { var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result2 = object ? customizer(value, key, object, stack) : customizer(value); } if (result2 !== undefined2) { return result2; } if (!isObject2(value)) { return value; } var isArr = isArray2(value); if (isArr) { result2 = initCloneArray(value); if (!isDeep) { return copyArray(value, result2); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || isFunc && !object) { result2 = isFlat || isFunc ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result2 = initCloneByTag(value, tag, isDeep); } } stack || (stack = new Stack()); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result2); if (isSet2(value)) { value.forEach(function(subValue) { result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); } else if (isMap(value)) { value.forEach(function(subValue, key2) { result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); }); } var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; var props = isArr ? undefined2 : keysFunc(value); arrayEach(props || value, function(subValue, key2) { if (props) { key2 = subValue; subValue = value[key2]; } assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); }); return result2; } function baseConforms(source) { var props = keys(source); return function(object) { return baseConformsTo(object, source, props); }; } function baseConformsTo(object, source, props) { var length = props.length; if (object == null) { return !length; } object = Object2(object); while (length--) { var key = props[length], predicate = source[key], value = object[key]; if (value === undefined2 && !(key in object) || !predicate(value)) { return false; } } return true; } function baseDelay(func, wait, args) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } return setTimeout2(function() { func.apply(undefined2, args); }, wait); } function baseDifference(array, values2, iteratee2, comparator) { var index = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length; if (!length) { return result2; } if (iteratee2) { values2 = arrayMap(values2, baseUnary(iteratee2)); } if (comparator) { includes2 = arrayIncludesWith; isCommon = false; } else if (values2.length >= LARGE_ARRAY_SIZE) { includes2 = cacheHas; isCommon = false; values2 = new SetCache(values2); } outer: while (++index < length) { var value = array[index], computed = iteratee2 == null ? value : iteratee2(value); value = comparator || value !== 0 ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values2[valuesIndex] === computed) { continue outer; } } result2.push(value); } else if (!includes2(values2, computed, comparator)) { result2.push(value); } } return result2; } var baseEach = createBaseEach(baseForOwn); var baseEachRight = createBaseEach(baseForOwnRight, true); function baseEvery(collection, predicate) { var result2 = true; baseEach(collection, function(value, index, collection2) { result2 = !!predicate(value, index, collection2); return result2; }); return result2; } function baseExtremum(array, iteratee2, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee2(value); if (current != null && (computed === undefined2 ? current === current && !isSymbol(current) : comparator(current, computed))) { var computed = current, result2 = value; } } return result2; } function baseFill(array, value, start4, end2) { var length = array.length; start4 = toInteger(start4); if (start4 < 0) { start4 = -start4 > length ? 0 : length + start4; } end2 = end2 === undefined2 || end2 > length ? length : toInteger(end2); if (end2 < 0) { end2 += length; } end2 = start4 > end2 ? 0 : toLength(end2); while (start4 < end2) { array[start4++] = value; } return array; } function baseFilter(collection, predicate) { var result2 = []; baseEach(collection, function(value, index, collection2) { if (predicate(value, index, collection2)) { result2.push(value); } }); return result2; } function baseFlatten(array, depth, predicate, isStrict, result2) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result2 || (result2 = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { baseFlatten(value, depth - 1, predicate, isStrict, result2); } else { arrayPush(result2, value); } } else if (!isStrict) { result2[result2.length] = value; } } return result2; } var baseFor = createBaseFor(); var baseForRight = createBaseFor(true); function baseForOwn(object, iteratee2) { return object && baseFor(object, iteratee2, keys); } function baseForOwnRight(object, iteratee2) { return object && baseForRight(object, iteratee2, keys); } function baseFunctions(object, props) { return arrayFilter(props, function(key) { return isFunction(object[key]); }); } function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return index && index == length ? object : undefined2; } function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result2 = keysFunc(object); return isArray2(object) ? result2 : arrayPush(result2, symbolsFunc(object)); } function baseGetTag(value) { if (value == null) { return value === undefined2 ? undefinedTag : nullTag; } return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value); } function baseGt(value, other) { return value > other; } function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } function baseHasIn(object, key) { return object != null && key in Object2(object); } function baseInRange(number, start4, end2) { return number >= nativeMin(start4, end2) && number < nativeMax(start4, end2); } function baseIntersection(arrays, iteratee2, comparator) { var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee2) { array = arrayMap(array, baseUnary(iteratee2)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined2; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result2.length < maxLength) { var value = array[index], computed = iteratee2 ? iteratee2(value) : value; value = comparator || value !== 0 ? value : 0; if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) { othIndex = othLength; while (--othIndex) { var cache2 = caches[othIndex]; if (!(cache2 ? cacheHas(cache2, computed) : includes2(arrays[othIndex], computed, comparator))) { continue outer; } } if (seen) { seen.push(computed); } result2.push(value); } } return result2; } function baseInverter(object, setter, iteratee2, accumulator) { baseForOwn(object, function(value, key, object2) { setter(accumulator, iteratee2(value), key, object2); }); return accumulator; } function baseInvoke(object, path, args) { path = castPath(path, object); object = parent(object, path); var func = object == null ? object : object[toKey(last(path))]; return func == null ? undefined2 : apply(func, object, args); } function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } function baseIsArrayBuffer(value) { return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; } function baseIsDate(value) { return isObjectLike(value) && baseGetTag(value) == dateTag; } function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray2(object), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack()); return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__"); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack()); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack()); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag; } function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object2(object); while (index--) { var data = matchData[index]; if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined2 && !(key in object)) { return false; } } else { var stack = new Stack(); if (customizer) { var result2 = customizer(objValue, srcValue, key, object, source, stack); } if (!(result2 === undefined2 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) { return false; } } } return true; } function baseIsNative(value) { if (!isObject2(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } function baseIsRegExp(value) { return isObjectLike(value) && baseGetTag(value) == regexpTag; } function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag; } function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } function baseIteratee(value) { if (typeof value == "function") { return value; } if (value == null) { return identity; } if (typeof value == "object") { return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result2 = []; for (var key in Object2(object)) { if (hasOwnProperty.call(object, key) && key != "constructor") { result2.push(key); } } return result2; } function baseKeysIn(object) { if (!isObject2(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result2 = []; for (var key in object) { if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) { result2.push(key); } } return result2; } function baseLt(value, other) { return value < other; } function baseMap(collection, iteratee2) { var index = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : []; baseEach(collection, function(value, key, collection2) { result2[++index] = iteratee2(value, key, collection2); }); return result2; } function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } return function(object) { var objValue = get4(object, path); return objValue === undefined2 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { stack || (stack = new Stack()); if (isObject2(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined2; if (newValue === undefined2) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined2; var isCommon = newValue === undefined2; if (isCommon) { var isArr = isArray2(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray2(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject2(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack["delete"](srcValue); } assignMergeValue(object, key, newValue); } function baseNth(array, n) { var length = array.length; if (!length) { return; } n += n < 0 ? length : 0; return isIndex(n, length) ? array[n] : undefined2; } function baseOrderBy(collection, iteratees, orders) { if (iteratees.length) { iteratees = arrayMap(iteratees, function(iteratee2) { if (isArray2(iteratee2)) { return function(value) { return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2); }; } return iteratee2; }); } else { iteratees = [identity]; } var index = -1; iteratees = arrayMap(iteratees, baseUnary(getIteratee())); var result2 = baseMap(collection, function(value, key, collection2) { var criteria = arrayMap(iteratees, function(iteratee2) { return iteratee2(value); }); return { "criteria": criteria, "index": ++index, "value": value }; }); return baseSortBy(result2, function(object, other) { return compareMultiple(object, other, orders); }); } function basePick(object, paths) { return basePickBy(object, paths, function(value, path) { return hasIn(object, path); }); } function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result2 = {}; while (++index < length) { var path = paths[index], value = baseGet(object, path); if (predicate(value, path)) { baseSet(result2, castPath(path, object), value); } } return result2; } function basePropertyDeep(path) { return function(object) { return baseGet(object, path); }; } function basePullAll(array, values2, iteratee2, comparator) { var indexOf3 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array; if (array === values2) { values2 = copyArray(values2); } if (iteratee2) { seen = arrayMap(array, baseUnary(iteratee2)); } while (++index < length) { var fromIndex = 0, value = values2[index], computed = iteratee2 ? iteratee2(value) : value; while ((fromIndex = indexOf3(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } splice.call(array, fromIndex, 1); } } return array; } function basePullAt(array, indexes) { var length = array ? indexes.length : 0, lastIndex = length - 1; while (length--) { var index = indexes[length]; if (length == lastIndex || index !== previous) { var previous = index; if (isIndex(index)) { splice.call(array, index, 1); } else { baseUnset(array, index); } } } return array; } function baseRandom(lower, upper) { return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); } function baseRange(start4, end2, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end2 - start4) / (step || 1)), 0), result2 = Array2(length); while (length--) { result2[fromRight ? length : ++index] = start4; start4 += step; } return result2; } function baseRepeat(string, n) { var result2 = ""; if (!string || n < 1 || n > MAX_SAFE_INTEGER) { return result2; } do { if (n % 2) { result2 += string; } n = nativeFloor(n / 2); if (n) { string += string; } } while (n); return result2; } function baseRest(func, start4) { return setToString(overRest(func, start4, identity), func + ""); } function baseSample(collection) { return arraySample(values(collection)); } function baseSampleSize(collection, n) { var array = values(collection); return shuffleSelf(array, baseClamp(n, 0, array.length)); } function baseSet(object, path, value, customizer) { if (!isObject2(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (key === "__proto__" || key === "constructor" || key === "prototype") { return object; } if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined2; if (newValue === undefined2) { newValue = isObject2(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {}; } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, "toString", { "configurable": true, "enumerable": false, "value": constant(string), "writable": true }); }; function baseShuffle(collection) { return shuffleSelf(values(collection)); } function baseSlice(array, start4, end2) { var index = -1, length = array.length; if (start4 < 0) { start4 = -start4 > length ? 0 : length + start4; } end2 = end2 > length ? length : end2; if (end2 < 0) { end2 += length; } length = start4 > end2 ? 0 : end2 - start4 >>> 0; start4 >>>= 0; var result2 = Array2(length); while (++index < length) { result2[index] = array[index + start4]; } return result2; } function baseSome(collection, predicate) { var result2; baseEach(collection, function(value, index, collection2) { result2 = predicate(value, index, collection2); return !result2; }); return !!result2; } function baseSortedIndex(array, value, retHighest) { var low = 0, high = array == null ? low : array.length; if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = low + high >>> 1, computed = array[mid]; if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) { low = mid + 1; } else { high = mid; } } return high; } return baseSortedIndexBy(array, value, identity, retHighest); } function baseSortedIndexBy(array, value, iteratee2, retHighest) { var low = 0, high = array == null ? 0 : array.length; if (high === 0) { return 0; } value = iteratee2(value); var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined2; while (low < high) { var mid = nativeFloor((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== undefined2, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed); if (valIsNaN) { var setLow = retHighest || othIsReflexive; } else if (valIsUndefined) { setLow = othIsReflexive && (retHighest || othIsDefined); } else if (valIsNull) { setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); } else if (valIsSymbol) { setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); } else if (othIsNull || othIsSymbol) { setLow = false; } else { setLow = retHighest ? computed <= value : computed < value; } if (setLow) { low = mid + 1; } else { high = mid; } } return nativeMin(high, MAX_ARRAY_INDEX); } function baseSortedUniq(array, iteratee2) { var index = -1, length = array.length, resIndex = 0, result2 = []; while (++index < length) { var value = array[index], computed = iteratee2 ? iteratee2(value) : value; if (!index || !eq(computed, seen)) { var seen = computed; result2[resIndex++] = value === 0 ? 0 : value; } } return result2; } function baseToNumber(value) { if (typeof value == "number") { return value; } if (isSymbol(value)) { return NAN; } return +value; } function baseToString(value) { if (typeof value == "string") { return value; } if (isArray2(value)) { return arrayMap(value, baseToString) + ""; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ""; } var result2 = value + ""; return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; } function baseUniq(array, iteratee2, comparator) { var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2; if (comparator) { isCommon = false; includes2 = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set3 = iteratee2 ? null : createSet(array); if (set3) { return setToArray(set3); } isCommon = false; includes2 = cacheHas; seen = new SetCache(); } else { seen = iteratee2 ? [] : result2; } outer: while (++index < length) { var value = array[index], computed = iteratee2 ? iteratee2(value) : value; value = comparator || value !== 0 ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee2) { seen.push(computed); } result2.push(value); } else if (!includes2(seen, computed, comparator)) { if (seen !== result2) { seen.push(computed); } result2.push(value); } } return result2; } function baseUnset(object, path) { path = castPath(path, object); object = parent(object, path); return object == null || delete object[toKey(last(path))]; } function baseUpdate(object, path, updater, customizer) { return baseSet(object, path, updater(baseGet(object, path)), customizer); } function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) { } return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index); } function baseWrapperValue(value, actions) { var result2 = value; if (result2 instanceof LazyWrapper) { result2 = result2.value(); } return arrayReduce(actions, function(result3, action) { return action.func.apply(action.thisArg, arrayPush([result3], action.args)); }, result2); } function baseXor(arrays, iteratee2, comparator) { var length = arrays.length; if (length < 2) { return length ? baseUniq(arrays[0]) : []; } var index = -1, result2 = Array2(length); while (++index < length) { var array = arrays[index], othIndex = -1; while (++othIndex < length) { if (othIndex != index) { result2[index] = baseDifference(result2[index] || array, arrays[othIndex], iteratee2, comparator); } } } return baseUniq(baseFlatten(result2, 1), iteratee2, comparator); } function baseZipObject(props, values2, assignFunc) { var index = -1, length = props.length, valsLength = values2.length, result2 = {}; while (++index < length) { var value = index < valsLength ? values2[index] : undefined2; assignFunc(result2, props[index], value); } return result2; } function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } function castFunction(value) { return typeof value == "function" ? value : identity; } function castPath(value, object) { if (isArray2(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } var castRest = baseRest; function castSlice(array, start4, end2) { var length = array.length; end2 = end2 === undefined2 ? length : end2; return !start4 && end2 >= length ? array : baseSlice(array, start4, end2); } var clearTimeout2 = ctxClearTimeout || function(id) { return root.clearTimeout(id); }; function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result2); return result2; } function cloneArrayBuffer(arrayBuffer) { var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer)); return result2; } function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } function cloneRegExp(regexp) { var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result2.lastIndex = regexp.lastIndex; return result2; } function cloneSymbol(symbol) { return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {}; } function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined2, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined2, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { return 1; } if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { return -1; } } return 0; } function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result2 = compareAscending(objCriteria[index], othCriteria[index]); if (result2) { if (index >= ordersLength) { return result2; } var order2 = orders[index]; return result2 * (order2 == "desc" ? -1 : 1); } } return object.index - other.index; } function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result2[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result2[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result2[leftIndex++] = args[argsIndex++]; } return result2; } function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result2[argsIndex] = args[argsIndex]; } var offset2 = argsIndex; while (++rightIndex < rightLength) { result2[offset2 + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result2[offset2 + holders[holdersIndex]] = args[argsIndex++]; } } return result2; } function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array2(length)); while (++index < length) { array[index] = source[index]; } return array; } function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined2; if (newValue === undefined2) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } function createAggregator(setter, initializer) { return function(collection, iteratee2) { var func = isArray2(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, getIteratee(iteratee2, 2), accumulator); }; } function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined2, guard = length > 2 ? sources[2] : undefined2; customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined2; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined2 : customizer; length = 1; } object = Object2(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee2) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee2); } var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection); while (fromRight ? index-- : ++index < length) { if (iteratee2(iterable[index], index, iterable) === false) { break; } } return collection; }; } function createBaseFor(fromRight) { return function(object, iteratee2, keysFunc) { var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee2(iterable[key], key, iterable) === false) { break; } } return object; }; } function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn2 = this && this !== root && this instanceof wrapper ? Ctor : func; return fn2.apply(isBind ? thisArg : this, arguments); } return wrapper; } function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined2; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1); return chr[methodName]() + trailing; }; } function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, "")), callback, ""); }; } function createCtor(Ctor) { return function() { var args = arguments; switch (args.length) { case 0: return new Ctor(); case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args); return isObject2(result2) ? result2 : thisBinding; }; } function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, undefined2, args, holders, undefined2, undefined2, arity - length ); } var fn2 = this && this !== root && this instanceof wrapper ? Ctor : func; return apply(fn2, this, args); } return wrapper; } function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object2(collection); if (!isArrayLike(collection)) { var iteratee2 = getIteratee(predicate, 3); collection = keys(collection); predicate = function(key) { return iteratee2(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined2; }; } function createFlow(fromRight) { return flatRest(function(funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); } while (index--) { var func = funcs[index]; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } if (prereq && !wrapper && getFuncName(func) == "wrapper") { var wrapper = new LodashWrapper([], true); } } index = wrapper ? index : length; while (++index < length) { func = funcs[index]; var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined2; if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; if (wrapper && args.length == 1 && isArray2(value)) { return wrapper.plant(value).value(); } var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value; while (++index2 < length) { result2 = funcs[index2].call(this, result2); } return result2; }; }); } function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) { var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined2 : createCtor(func); function wrapper() { var length = arguments.length, args = Array2(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary2, arity - length ); } var thisBinding = isBind ? thisArg : this, fn2 = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary2 < length) { args.length = ary2; } if (this && this !== root && this instanceof wrapper) { fn2 = Ctor || createCtor(fn2); } return fn2.apply(thisBinding, args); } return wrapper; } function createInverter(setter, toIteratee) { return function(object, iteratee2) { return baseInverter(object, setter, toIteratee(iteratee2), {}); }; } function createMathOperation(operator, defaultValue) { return function(value, other) { var result2; if (value === undefined2 && other === undefined2) { return defaultValue; } if (value !== undefined2) { result2 = value; } if (other !== undefined2) { if (result2 === undefined2) { return other; } if (typeof value == "string" || typeof other == "string") { value = baseToString(value); other = baseToString(other); } else { value = baseToNumber(value); other = baseToNumber(other); } result2 = operator(value, other); } return result2; }; } function createOver(arrayFunc) { return flatRest(function(iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())); return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee2) { return apply(iteratee2, thisArg, args); }); }); }); } function createPadding(length, chars) { chars = chars === undefined2 ? " " : baseToString(chars); var charsLength = chars.length; if (charsLength < 2) { return charsLength ? baseRepeat(chars, length) : chars; } var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length); } function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn2 = this && this !== root && this instanceof wrapper ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn2, isBind ? thisArg : this, args); } return wrapper; } function createRange(fromRight) { return function(start4, end2, step) { if (step && typeof step != "number" && isIterateeCall(start4, end2, step)) { end2 = step = undefined2; } start4 = toFinite(start4); if (end2 === undefined2) { end2 = start4; start4 = 0; } else { end2 = toFinite(end2); } step = step === undefined2 ? start4 < end2 ? 1 : -1 : toFinite(step); return baseRange(start4, end2, step, fromRight); }; } function createRelationalOperation(operator) { return function(value, other) { if (!(typeof value == "string" && typeof other == "string")) { value = toNumber(value); other = toNumber(other); } return operator(value, other); }; } function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined2, newHoldersRight = isCurry ? undefined2 : holders, newPartials = isCurry ? partials : undefined2, newPartialsRight = isCurry ? undefined2 : partials; bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG; bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary2, arity ]; var result2 = wrapFunc.apply(undefined2, newData); if (isLaziable(func)) { setData(result2, newData); } result2.placeholder = placeholder; return setWrapToString(result2, func, bitmask); } function createRound(methodName) { var func = Math2[methodName]; return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); if (precision && nativeIsFinite(number)) { var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision)); pair = (toString(value) + "e").split("e"); return +(pair[0] + "e" + (+pair[1] - precision)); } return func(number); }; } var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop2 : function(values2) { return new Set2(values2); }; function createToPairs(keysFunc) { return function(object) { var tag = getTag(object); if (tag == mapTag) { return mapToArray(object); } if (tag == setTag) { return setToPairs(object); } return baseToPairs(object, keysFunc(object)); }; } function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = undefined2; } ary2 = ary2 === undefined2 ? ary2 : nativeMax(toInteger(ary2), 0); arity = arity === undefined2 ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined2; } var data = isBindKey ? undefined2 : getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined2 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result2 = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { result2 = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result2 = createPartial(func, bitmask, thisArg, partials); } else { result2 = createHybrid.apply(undefined2, newData); } var setter = data ? baseSetData : setData; return setWrapToString(setter(result2, newData), func, bitmask); } function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined2 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) { return srcValue; } return objValue; } function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject2(objValue) && isObject2(srcValue)) { stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack); stack["delete"](srcValue); } return objValue; } function customOmitClone(value) { return isPlainObject(value) ? undefined2 : value; } function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } var arrStacked = stack.get(array); var othStacked = stack.get(other); if (arrStacked && othStacked) { return arrStacked == other && othStacked == array; } var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined2; stack.set(array, other); stack.set(other, array); while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined2) { if (compared) { continue; } result2 = false; break; } if (seen) { if (!arraySome(other, function(othValue2, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result2 = false; break; } } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { result2 = false; break; } } stack["delete"](array); stack["delete"](other); return result2; } function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: return object == other + ""; case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; stack.set(object, other); var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack["delete"](object); return result2; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } var objStacked = stack.get(object); var othStacked = stack.get(other); if (objStacked && othStacked) { return objStacked == other && othStacked == object; } var result2 = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } if (!(compared === undefined2 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { result2 = false; break; } skipCtor || (skipCtor = key == "constructor"); } if (result2 && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { result2 = false; } } stack["delete"](object); stack["delete"](other); return result2; } function flatRest(func) { return setToString(overRest(func, undefined2, flatten), func + ""); } function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } var getData = !metaMap ? noop2 : function(func) { return metaMap.get(func); }; function getFuncName(func) { var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty.call(realNames, result2) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result2; } function getHolder(func) { var object = hasOwnProperty.call(lodash, "placeholder") ? lodash : func; return object.placeholder; } function getIteratee() { var result2 = lodash.iteratee || iteratee; result2 = result2 === iteratee ? baseIteratee : result2; return arguments.length ? result2(arguments[0], arguments[1]) : result2; } function getMapData(map2, key) { var data = map2.__data__; return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; } function getMatchData(object) { var result2 = keys(object), length = result2.length; while (length--) { var key = result2[length], value = object[key]; result2[length] = [key, value, isStrictComparable(value)]; } return result2; } function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined2; } function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined2; var unmasked = true; } catch (e) { } var result2 = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result2; } var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object2(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result2 = []; while (object) { arrayPush(result2, getSymbols(object)); object = getPrototype(object); } return result2; }; var getTag = baseGetTag; if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) { getTag = function(value) { var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined2, ctorString = Ctor ? toSource(Ctor) : ""; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result2; }; } function getView(start4, end2, transforms) { var index = -1, length = transforms.length; while (++index < length) { var data = transforms[index], size2 = data.size; switch (data.type) { case "drop": start4 += size2; break; case "dropRight": end2 -= size2; break; case "take": end2 = nativeMin(end2, start4 + size2); break; case "takeRight": start4 = nativeMax(start4, end2 - size2); break; } } return { "start": start4, "end": end2 }; } function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result2 = false; while (++index < length) { var key = toKey(path[index]); if (!(result2 = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result2 || ++index != length) { return result2; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray2(object) || isArguments(object)); } function initCloneArray(array) { var length = array.length, result2 = new array.constructor(length); if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) { result2.index = array.index; result2.input = array.input; } return result2; } function initCloneObject(object) { return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; } function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor(+object); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return new Ctor(); case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return new Ctor(); case symbolTag: return cloneSymbol(object); } } function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex]; details = details.join(length > 2 ? ", " : " "); return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n"); } function isFlattenable(value) { return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } function isIterateeCall(value, index, object) { if (!isObject2(object)) { return false; } var type = typeof index; if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) { return eq(object[index], value); } return false; } function isKey(value, object) { if (isArray2(value)) { return false; } var type = typeof value; if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object); } function isKeyable(value) { var type = typeof value; return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; } function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } function isMasked(func) { return !!maskSrcKey && maskSrcKey in func; } var isMaskable = coreJsData ? isFunction : stubFalse; function isPrototype(value) { var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; return value === proto; } function isStrictComparable(value) { return value === value && !isObject2(value); } function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined2 || key in Object2(object)); }; } function memoizeCapped(func) { var result2 = memoize(func, function(key) { if (cache2.size === MAX_MEMOIZE_SIZE) { cache2.clear(); } return key; }); var cache2 = result2.cache; return result2; } function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG; if (!(isCommon || isCombo)) { return data; } if (srcBitmask & WRAP_BIND_FLAG) { data[2] = source[2]; newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; } var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } value = source[7]; if (value) { data[7] = value; } if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } if (data[9] == null) { data[9] = source[9]; } data[0] = source[0]; data[1] = newBitmask; return data; } function nativeKeysIn(object) { var result2 = []; if (object != null) { for (var key in Object2(object)) { result2.push(key); } } return result2; } function objectToString(value) { return nativeObjectToString.call(value); } function overRest(func, start4, transform2) { start4 = nativeMax(start4 === undefined2 ? func.length - 1 : start4, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start4, 0), array = Array2(length); while (++index < length) { array[index] = args[start4 + index]; } index = -1; var otherArgs = Array2(start4 + 1); while (++index < start4) { otherArgs[index] = args[index]; } otherArgs[start4] = transform2(array); return apply(func, this, otherArgs); }; } function parent(object, path) { return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined2; } return array; } function safeGet(object, key) { if (key === "constructor" && typeof object[key] === "function") { return; } if (key == "__proto__") { return; } return object[key]; } var setData = shortOut(baseSetData); var setTimeout2 = ctxSetTimeout || function(func, wait) { return root.setTimeout(func, wait); }; var setToString = shortOut(baseSetToString); function setWrapToString(wrapper, reference2, bitmask) { var source = reference2 + ""; return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined2, arguments); }; } function shuffleSelf(array, size2) { var index = -1, length = array.length, lastIndex = length - 1; size2 = size2 === undefined2 ? length : size2; while (++index < size2) { var rand = baseRandom(index, lastIndex), value = array[rand]; array[rand] = array[index]; array[index] = value; } array.length = size2; return array; } var stringToPath = memoizeCapped(function(string) { var result2 = []; if (string.charCodeAt(0) === 46) { result2.push(""); } string.replace(rePropName, function(match, number, quote, subString) { result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match); }); return result2; }); function toKey(value) { if (typeof value == "string" || isSymbol(value)) { return value; } var result2 = value + ""; return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; } function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) { } try { return func + ""; } catch (e) { } } return ""; } function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = "_." + pair[0]; if (bitmask & pair[1] && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result2.__actions__ = copyArray(wrapper.__actions__); result2.__index__ = wrapper.__index__; result2.__values__ = wrapper.__values__; return result2; } function chunk(array, size2, guard) { if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined2) { size2 = 1; } else { size2 = nativeMax(toInteger(size2), 0); } var length = array == null ? 0 : array.length; if (!length || size2 < 1) { return []; } var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2)); while (index < length) { result2[resIndex++] = baseSlice(array, index, index += size2); } return result2; } function compact2(array) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = []; while (++index < length) { var value = array[index]; if (value) { result2[resIndex++] = value; } } return result2; } function concat() { var length = arguments.length; if (!length) { return []; } var args = Array2(length - 1), array = arguments[0], index = length; while (index--) { args[index - 1] = arguments[index]; } return arrayPush(isArray2(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } var difference = baseRest(function(array, values2) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : []; }); var differenceBy = baseRest(function(array, values2) { var iteratee2 = last(values2); if (isArrayLikeObject(iteratee2)) { iteratee2 = undefined2; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : []; }); var differenceWith = baseRest(function(array, values2) { var comparator = last(values2); if (isArrayLikeObject(comparator)) { comparator = undefined2; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined2, comparator) : []; }); function drop(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = guard || n === undefined2 ? 1 : toInteger(n); return baseSlice(array, n < 0 ? 0 : n, length); } function dropRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = guard || n === undefined2 ? 1 : toInteger(n); n = length - n; return baseSlice(array, 0, n < 0 ? 0 : n); } function dropRightWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; } function dropWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : []; } function fill(array, value, start4, end2) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (start4 && typeof start4 != "number" && isIterateeCall(array, value, start4)) { start4 = 0; end2 = length; } return baseFill(array, value, start4, end2); } function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, getIteratee(predicate, 3), index); } function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length - 1; if (fromIndex !== undefined2) { index = toInteger(fromIndex); index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return baseFindIndex(array, getIteratee(predicate, 3), index, true); } function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } function flattenDeep2(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, INFINITY) : []; } function flattenDepth(array, depth) { var length = array == null ? 0 : array.length; if (!length) { return []; } depth = depth === undefined2 ? 1 : toInteger(depth); return baseFlatten(array, depth); } function fromPairs(pairs) { var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {}; while (++index < length) { var pair = pairs[index]; result2[pair[0]] = pair[1]; } return result2; } function head(array) { return array && array.length ? array[0] : undefined2; } function indexOf2(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseIndexOf(array, value, index); } function initial(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 0, -1) : []; } var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : []; }); var intersectionBy = baseRest(function(arrays) { var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee2 === last(mapped)) { iteratee2 = undefined2; } else { mapped.pop(); } return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : []; }); var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); comparator = typeof comparator == "function" ? comparator : undefined2; if (comparator) { mapped.pop(); } return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : []; }); function join(array, separator) { return array == null ? "" : nativeJoin.call(array, separator); } function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined2; } function lastIndexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length; if (fromIndex !== undefined2) { index = toInteger(fromIndex); index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); } function nth(array, n) { return array && array.length ? baseNth(array, toInteger(n)) : undefined2; } var pull = baseRest(pullAll); function pullAll(array, values2) { return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array; } function pullAllBy(array, values2, iteratee2) { return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array; } function pullAllWith(array, values2, comparator) { return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined2, comparator) : array; } var pullAt = flatRest(function(array, indexes) { var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes); basePullAt(array, arrayMap(indexes, function(index) { return isIndex(index, length) ? +index : index; }).sort(compareAscending)); return result2; }); function remove(array, predicate) { var result2 = []; if (!(array && array.length)) { return result2; } var index = -1, indexes = [], length = array.length; predicate = getIteratee(predicate, 3); while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result2.push(value); indexes.push(index); } } basePullAt(array, indexes); return result2; } function reverse(array) { return array == null ? array : nativeReverse.call(array); } function slice(array, start4, end2) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (end2 && typeof end2 != "number" && isIterateeCall(array, start4, end2)) { start4 = 0; end2 = length; } else { start4 = start4 == null ? 0 : toInteger(start4); end2 = end2 === undefined2 ? length : toInteger(end2); } return baseSlice(array, start4, end2); } function sortedIndex(array, value) { return baseSortedIndex(array, value); } function sortedIndexBy(array, value, iteratee2) { return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2)); } function sortedIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value); if (index < length && eq(array[index], value)) { return index; } } return -1; } function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); } function sortedLastIndexBy(array, value, iteratee2) { return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true); } function sortedLastIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value, true) - 1; if (eq(array[index], value)) { return index; } } return -1; } function sortedUniq(array) { return array && array.length ? baseSortedUniq(array) : []; } function sortedUniqBy(array, iteratee2) { return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : []; } function tail(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 1, length) : []; } function take(array, n, guard) { if (!(array && array.length)) { return []; } n = guard || n === undefined2 ? 1 : toInteger(n); return baseSlice(array, 0, n < 0 ? 0 : n); } function takeRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = guard || n === undefined2 ? 1 : toInteger(n); n = length - n; return baseSlice(array, n < 0 ? 0 : n, length); } function takeRightWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; } function takeWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : []; } var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); var unionBy = baseRest(function(arrays) { var iteratee2 = last(arrays); if (isArrayLikeObject(iteratee2)) { iteratee2 = undefined2; } return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)); }); var unionWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == "function" ? comparator : undefined2; return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined2, comparator); }); function uniq2(array) { return array && array.length ? baseUniq(array) : []; } function uniqBy(array, iteratee2) { return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : []; } function uniqWith(array, comparator) { comparator = typeof comparator == "function" ? comparator : undefined2; return array && array.length ? baseUniq(array, undefined2, comparator) : []; } function unzip(array) { if (!(array && array.length)) { return []; } var length = 0; array = arrayFilter(array, function(group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); return baseTimes(length, function(index) { return arrayMap(array, baseProperty(index)); }); } function unzipWith(array, iteratee2) { if (!(array && array.length)) { return []; } var result2 = unzip(array); if (iteratee2 == null) { return result2; } return arrayMap(result2, function(group) { return apply(iteratee2, undefined2, group); }); } var without = baseRest(function(array, values2) { return isArrayLikeObject(array) ? baseDifference(array, values2) : []; }); var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); var xorBy = baseRest(function(arrays) { var iteratee2 = last(arrays); if (isArrayLikeObject(iteratee2)) { iteratee2 = undefined2; } return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2)); }); var xorWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == "function" ? comparator : undefined2; return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined2, comparator); }); var zip2 = baseRest(unzip); function zipObject2(props, values2) { return baseZipObject(props || [], values2 || [], assignValue); } function zipObjectDeep(props, values2) { return baseZipObject(props || [], values2 || [], baseSet); } var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined2; iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined2; return unzipWith(arrays, iteratee2); }); function chain(value) { var result2 = lodash(value); result2.__chain__ = true; return result2; } function tap(value, interceptor) { interceptor(value); return value; } function thru(value, interceptor) { return interceptor(value); } var wrapperAt = flatRest(function(paths) { var length = paths.length, start4 = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { return baseAt(object, paths); }; if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start4)) { return this.thru(interceptor); } value = value.slice(start4, +start4 + (length ? 1 : 0)); value.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined2 }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined2); } return array; }); }); function wrapperChain() { return chain(this); } function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } function wrapperNext() { if (this.__values__ === undefined2) { this.__values__ = toArray(this.value()); } var done = this.__index__ >= this.__values__.length, value = done ? undefined2 : this.__values__[this.__index__++]; return { "done": done, "value": value }; } function wrapperToIterator() { return this; } function wrapperPlant(value) { var result2, parent2 = this; while (parent2 instanceof baseLodash) { var clone2 = wrapperClone(parent2); clone2.__index__ = 0; clone2.__values__ = undefined2; if (result2) { previous.__wrapped__ = clone2; } else { result2 = clone2; } var previous = clone2; parent2 = parent2.__wrapped__; } previous.__wrapped__ = value; return result2; } function wrapperReverse() { var value = this.__wrapped__; if (value instanceof LazyWrapper) { var wrapped = value; if (this.__actions__.length) { wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); wrapped.__actions__.push({ "func": thru, "args": [reverse], "thisArg": undefined2 }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); } function wrapperValue() { return baseWrapperValue(this.__wrapped__, this.__actions__); } var countBy = createAggregator(function(result2, value, key) { if (hasOwnProperty.call(result2, key)) { ++result2[key]; } else { baseAssignValue(result2, key, 1); } }); function every(collection, predicate, guard) { var func = isArray2(collection) ? arrayEvery : baseEvery; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined2; } return func(collection, getIteratee(predicate, 3)); } function filter(collection, predicate) { var func = isArray2(collection) ? arrayFilter : baseFilter; return func(collection, getIteratee(predicate, 3)); } var find = createFind(findIndex); var findLast = createFind(findLastIndex); function flatMap(collection, iteratee2) { return baseFlatten(map(collection, iteratee2), 1); } function flatMapDeep(collection, iteratee2) { return baseFlatten(map(collection, iteratee2), INFINITY); } function flatMapDepth(collection, iteratee2, depth) { depth = depth === undefined2 ? 1 : toInteger(depth); return baseFlatten(map(collection, iteratee2), depth); } function forEach(collection, iteratee2) { var func = isArray2(collection) ? arrayEach : baseEach; return func(collection, getIteratee(iteratee2, 3)); } function forEachRight(collection, iteratee2) { var func = isArray2(collection) ? arrayEachRight : baseEachRight; return func(collection, getIteratee(iteratee2, 3)); } var groupBy = createAggregator(function(result2, value, key) { if (hasOwnProperty.call(result2, key)) { result2[key].push(value); } else { baseAssignValue(result2, key, [value]); } }); function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; } var invokeMap = baseRest(function(collection, path, args) { var index = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : []; baseEach(collection, function(value) { result2[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); }); return result2; }); var keyBy = createAggregator(function(result2, value, key) { baseAssignValue(result2, key, value); }); function map(collection, iteratee2) { var func = isArray2(collection) ? arrayMap : baseMap; return func(collection, getIteratee(iteratee2, 3)); } function orderBy(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (!isArray2(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined2 : orders; if (!isArray2(orders)) { orders = orders == null ? [] : [orders]; } return baseOrderBy(collection, iteratees, orders); } var partition = createAggregator(function(result2, value, key) { result2[key ? 0 : 1].push(value); }, function() { return [[], []]; }); function reduce(collection, iteratee2, accumulator) { var func = isArray2(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach); } function reduceRight(collection, iteratee2, accumulator) { var func = isArray2(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight); } function reject(collection, predicate) { var func = isArray2(collection) ? arrayFilter : baseFilter; return func(collection, negate(getIteratee(predicate, 3))); } function sample(collection) { var func = isArray2(collection) ? arraySample : baseSample; return func(collection); } function sampleSize(collection, n, guard) { if (guard ? isIterateeCall(collection, n, guard) : n === undefined2) { n = 1; } else { n = toInteger(n); } var func = isArray2(collection) ? arraySampleSize : baseSampleSize; return func(collection, n); } function shuffle(collection) { var func = isArray2(collection) ? arrayShuffle : baseShuffle; return func(collection); } function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { return isString(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } function some(collection, predicate, guard) { var func = isArray2(collection) ? arraySome : baseSome; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined2; } return func(collection, getIteratee(predicate, 3)); } var sortBy2 = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); var now2 = ctxNow || function() { return root.Date.now(); }; function after(n, func) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n < 1) { return func.apply(this, arguments); } }; } function ary(func, n, guard) { n = guard ? undefined2 : n; n = func && n == null ? func.length : n; return createWrap(func, WRAP_ARY_FLAG, undefined2, undefined2, undefined2, undefined2, n); } function before(n, func) { var result2; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n > 0) { result2 = func.apply(this, arguments); } if (n <= 1) { func = undefined2; } return result2; }; } var bind = baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(func, bitmask, thisArg, partials, holders); }); var bindKey = baseRest(function(object, key, partials) { var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(key, bitmask, object, partials, holders); }); function curry(func, arity, guard) { arity = guard ? undefined2 : arity; var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity); result2.placeholder = curry.placeholder; return result2; } function curryRight(func, arity, guard) { arity = guard ? undefined2 : arity; var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity); result2.placeholder = curryRight.placeholder; return result2; } function debounce3(func, wait, options) { var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject2(options)) { leading = !!options.leading; maxing = "maxWait" in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = "trailing" in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined2; lastInvokeTime = time; result2 = func.apply(thisArg, args); return result2; } function leadingEdge(time) { lastInvokeTime = time; timerId = setTimeout2(timerExpired, wait); return leading ? invokeFunc(time) : result2; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; return lastCallTime === undefined2 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; } function timerExpired() { var time = now2(); if (shouldInvoke(time)) { return trailingEdge(time); } timerId = setTimeout2(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined2; if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined2; return result2; } function cancel() { if (timerId !== undefined2) { clearTimeout2(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined2; } function flush() { return timerId === undefined2 ? result2 : trailingEdge(now2()); } function debounced() { var time = now2(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined2) { return leadingEdge(lastCallTime); } if (maxing) { clearTimeout2(timerId); timerId = setTimeout2(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined2) { timerId = setTimeout2(timerExpired, wait); } return result2; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); function flip2(func) { return createWrap(func, WRAP_FLIP_FLAG); } function memoize(func, resolver) { if (typeof func != "function" || resolver != null && typeof resolver != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache; if (cache2.has(key)) { return cache2.get(key); } var result2 = func.apply(this, args); memoized.cache = cache2.set(key, result2) || cache2; return result2; }; memoized.cache = new (memoize.Cache || MapCache)(); return memoized; } memoize.Cache = MapCache; function negate(predicate) { if (typeof predicate != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } return function() { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); case 1: return !predicate.call(this, args[0]); case 2: return !predicate.call(this, args[0], args[1]); case 3: return !predicate.call(this, args[0], args[1], args[2]); } return !predicate.apply(this, args); }; } function once(func) { return before(2, func); } var overArgs = castRest(function(func, transforms) { transforms = transforms.length == 1 && isArray2(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; return baseRest(function(args) { var index = -1, length = nativeMin(args.length, funcsLength); while (++index < length) { args[index] = transforms[index].call(this, args[index]); } return apply(func, this, args); }); }); var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); return createWrap(func, WRAP_PARTIAL_FLAG, undefined2, partials, holders); }); var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined2, partials, holders); }); var rearg = flatRest(function(func, indexes) { return createWrap(func, WRAP_REARG_FLAG, undefined2, undefined2, undefined2, indexes); }); function rest(func, start4) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } start4 = start4 === undefined2 ? start4 : toInteger(start4); return baseRest(func, start4); } function spread(func, start4) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } start4 = start4 == null ? 0 : nativeMax(toInteger(start4), 0); return baseRest(function(args) { var array = args[start4], otherArgs = castSlice(args, 0, start4); if (array) { arrayPush(otherArgs, array); } return apply(func, this, otherArgs); }); } function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } if (isObject2(options)) { leading = "leading" in options ? !!options.leading : leading; trailing = "trailing" in options ? !!options.trailing : trailing; } return debounce3(func, wait, { "leading": leading, "maxWait": wait, "trailing": trailing }); } function unary(func) { return ary(func, 1); } function wrap(value, wrapper) { return partial(castFunction(wrapper), value); } function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray2(value) ? value : [value]; } function clone(value) { return baseClone(value, CLONE_SYMBOLS_FLAG); } function cloneWith(value, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } function cloneDeepWith(value, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } function conformsTo(object, source) { return source == null || baseConformsTo(object, source, keys(source)); } function eq(value, other) { return value === other || value !== value && other !== other; } var gt = createRelationalOperation(baseGt); var gte = createRelationalOperation(function(value, other) { return value >= other; }); var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); }; var isArray2 = Array2.isArray; var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } function isBoolean(value) { return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag; } var isBuffer = nativeIsBuffer || stubFalse; var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; function isElement3(value) { return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); } function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray2(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } function isEqual(value, other) { return baseIsEqual(value, other); } function isEqualWith(value, other, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; var result2 = customizer ? customizer(value, other) : undefined2; return result2 === undefined2 ? baseIsEqual(value, other, undefined2, customizer) : !!result2; } function isError(value) { if (!isObjectLike(value)) { return false; } var tag = baseGetTag(value); return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value); } function isFinite2(value) { return typeof value == "number" && nativeIsFinite(value); } function isFunction(value) { if (!isObject2(value)) { return false; } var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } function isInteger(value) { return typeof value == "number" && value == toInteger(value); } function isLength(value) { return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } function isObject2(value) { var type = typeof value; return value != null && (type == "object" || type == "function"); } function isObjectLike(value) { return value != null && typeof value == "object"; } var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; function isMatch(object, source) { return object === source || baseIsMatch(object, source, getMatchData(source)); } function isMatchWith(object, source, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return baseIsMatch(object, source, getMatchData(source), customizer); } function isNaN2(value) { return isNumber(value) && value != +value; } function isNative(value) { if (isMaskable(value)) { throw new Error2(CORE_ERROR_TEXT); } return baseIsNative(value); } function isNull(value) { return value === null; } function isNil(value) { return value == null; } function isNumber(value) { return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag; } function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; function isSafeInteger(value) { return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } var isSet2 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; function isString(value) { return typeof value == "string" || !isArray2(value) && isObjectLike(value) && baseGetTag(value) == stringTag; } function isSymbol(value) { return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag; } var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; function isUndefined(value) { return value === undefined2; } function isWeakMap(value) { return isObjectLike(value) && getTag(value) == weakMapTag; } function isWeakSet(value) { return isObjectLike(value) && baseGetTag(value) == weakSetTag; } var lt = createRelationalOperation(baseLt); var lte = createRelationalOperation(function(value, other) { return value <= other; }); function toArray(value) { if (!value) { return []; } if (isArrayLike(value)) { return isString(value) ? stringToArray(value) : copyArray(value); } if (symIterator && value[symIterator]) { return iteratorToArray(value[symIterator]()); } var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values; return func(value); } function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = value < 0 ? -1 : 1; return sign * MAX_INTEGER; } return value === value ? value : 0; } function toInteger(value) { var result2 = toFinite(value), remainder = result2 % 1; return result2 === result2 ? remainder ? result2 - remainder : result2 : 0; } function toLength(value) { return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; } function toNumber(value) { if (typeof value == "number") { return value; } if (isSymbol(value)) { return NAN; } if (isObject2(value)) { var other = typeof value.valueOf == "function" ? value.valueOf() : value; value = isObject2(other) ? other + "" : other; } if (typeof value != "string") { return value === 0 ? value : +value; } value = baseTrim(value); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; } function toPlainObject(value) { return copyObject(value, keysIn(value)); } function toSafeInteger(value) { return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0; } function toString(value) { return value == null ? "" : baseToString(value); } var assign = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { if (hasOwnProperty.call(source, key)) { assignValue(object, key, source[key]); } } }); var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keys(source), object, customizer); }); var at = flatRest(baseAt); function create(prototype, properties) { var result2 = baseCreate(prototype); return properties == null ? result2 : baseAssign(result2, properties); } var defaults = baseRest(function(object, sources) { object = Object2(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined2; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined2 || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) { object[key] = source[key]; } } } return object; }); var defaultsDeep = baseRest(function(args) { args.push(undefined2, customDefaultsMerge); return apply(mergeWith, undefined2, args); }); function findKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); } function findLastKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); } function forIn(object, iteratee2) { return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn); } function forInRight(object, iteratee2) { return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn); } function forOwn(object, iteratee2) { return object && baseForOwn(object, getIteratee(iteratee2, 3)); } function forOwnRight(object, iteratee2) { return object && baseForOwnRight(object, getIteratee(iteratee2, 3)); } function functions(object) { return object == null ? [] : baseFunctions(object, keys(object)); } function functionsIn(object) { return object == null ? [] : baseFunctions(object, keysIn(object)); } function get4(object, path, defaultValue) { var result2 = object == null ? undefined2 : baseGet(object, path); return result2 === undefined2 ? defaultValue : result2; } function has2(object, path) { return object != null && hasPath(object, path, baseHas); } function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } var invert = createInverter(function(result2, value, key) { if (value != null && typeof value.toString != "function") { value = nativeObjectToString.call(value); } result2[value] = key; }, constant(identity)); var invertBy = createInverter(function(result2, value, key) { if (value != null && typeof value.toString != "function") { value = nativeObjectToString.call(value); } if (hasOwnProperty.call(result2, value)) { result2[value].push(key); } else { result2[value] = [key]; } }, getIteratee); var invoke = baseRest(baseInvoke); function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } function mapKeys(object, iteratee2) { var result2 = {}; iteratee2 = getIteratee(iteratee2, 3); baseForOwn(object, function(value, key, object2) { baseAssignValue(result2, iteratee2(value, key, object2), value); }); return result2; } function mapValues(object, iteratee2) { var result2 = {}; iteratee2 = getIteratee(iteratee2, 3); baseForOwn(object, function(value, key, object2) { baseAssignValue(result2, key, iteratee2(value, key, object2)); }); return result2; } var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); var omit = flatRest(function(object, paths) { var result2 = {}; if (object == null) { return result2; } var isDeep = false; paths = arrayMap(paths, function(path) { path = castPath(path, object); isDeep || (isDeep = path.length > 1); return path; }); copyObject(object, getAllKeysIn(object), result2); if (isDeep) { result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length = paths.length; while (length--) { baseUnset(result2, paths[length]); } return result2; }); function omitBy(object, predicate) { return pickBy(object, negate(getIteratee(predicate))); } var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); function pickBy(object, predicate) { if (object == null) { return {}; } var props = arrayMap(getAllKeysIn(object), function(prop) { return [prop]; }); predicate = getIteratee(predicate); return basePickBy(object, props, function(value, path) { return predicate(value, path[0]); }); } function result(object, path, defaultValue) { path = castPath(path, object); var index = -1, length = path.length; if (!length) { length = 1; object = undefined2; } while (++index < length) { var value = object == null ? undefined2 : object[toKey(path[index])]; if (value === undefined2) { index = length; value = defaultValue; } object = isFunction(value) ? value.call(object) : value; } return object; } function set2(object, path, value) { return object == null ? object : baseSet(object, path, value); } function setWith(object, path, value, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return object == null ? object : baseSet(object, path, value, customizer); } var toPairs = createToPairs(keys); var toPairsIn = createToPairs(keysIn); function transform(object, iteratee2, accumulator) { var isArr = isArray2(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee2 = getIteratee(iteratee2, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor() : []; } else if (isObject2(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) { return iteratee2(accumulator, value, index, object2); }); return accumulator; } function unset(object, path) { return object == null ? true : baseUnset(object, path); } function update(object, path, updater) { return object == null ? object : baseUpdate(object, path, castFunction(updater)); } function updateWith(object, path, updater, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); } function values(object) { return object == null ? [] : baseValues(object, keys(object)); } function valuesIn(object) { return object == null ? [] : baseValues(object, keysIn(object)); } function clamp(number, lower, upper) { if (upper === undefined2) { upper = lower; lower = undefined2; } if (upper !== undefined2) { upper = toNumber(upper); upper = upper === upper ? upper : 0; } if (lower !== undefined2) { lower = toNumber(lower); lower = lower === lower ? lower : 0; } return baseClamp(toNumber(number), lower, upper); } function inRange(number, start4, end2) { start4 = toFinite(start4); if (end2 === undefined2) { end2 = start4; start4 = 0; } else { end2 = toFinite(end2); } number = toNumber(number); return baseInRange(number, start4, end2); } function random(lower, upper, floating) { if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) { upper = floating = undefined2; } if (floating === undefined2) { if (typeof upper == "boolean") { floating = upper; upper = undefined2; } else if (typeof lower == "boolean") { floating = lower; lower = undefined2; } } if (lower === undefined2 && upper === undefined2) { lower = 0; upper = 1; } else { lower = toFinite(lower); if (upper === undefined2) { upper = lower; lower = 0; } else { upper = toFinite(upper); } } if (lower > upper) { var temp = lower; lower = upper; upper = temp; } if (floating || lower % 1 || upper % 1) { var rand = nativeRandom(); return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper); } return baseRandom(lower, upper); } var camelCase2 = createCompounder(function(result2, word, index) { word = word.toLowerCase(); return result2 + (index ? capitalize2(word) : word); }); function capitalize2(string) { return upperFirst(toString(string).toLowerCase()); } function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ""); } function endsWith(string, target, position) { string = toString(string); target = baseToString(target); var length = string.length; position = position === undefined2 ? length : baseClamp(toInteger(position), 0, length); var end2 = position; position -= target.length; return position >= 0 && string.slice(position, end2) == target; } function escape2(string) { string = toString(string); return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } function escapeRegExp(string) { string = toString(string); return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string; } var kebabCase = createCompounder(function(result2, word, index) { return result2 + (index ? "-" : "") + word.toLowerCase(); }); var lowerCase = createCompounder(function(result2, word, index) { return result2 + (index ? " " : "") + word.toLowerCase(); }); var lowerFirst = createCaseFirst("toLowerCase"); function pad(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } var mid = (length - strLength) / 2; return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars); } function padEnd(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return length && strLength < length ? string + createPadding(length - strLength, chars) : string; } function padStart(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return length && strLength < length ? createPadding(length - strLength, chars) + string : string; } function parseInt2(string, radix, guard) { if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0); } function repeat2(string, n, guard) { if (guard ? isIterateeCall(string, n, guard) : n === undefined2) { n = 1; } else { n = toInteger(n); } return baseRepeat(toString(string), n); } function replace() { var args = arguments, string = toString(args[0]); return args.length < 3 ? string : string.replace(args[1], args[2]); } var snakeCase = createCompounder(function(result2, word, index) { return result2 + (index ? "_" : "") + word.toLowerCase(); }); function split(string, separator, limit) { if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) { separator = limit = undefined2; } limit = limit === undefined2 ? MAX_ARRAY_LENGTH : limit >>> 0; if (!limit) { return []; } string = toString(string); if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) { separator = baseToString(separator); if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); } } return string.split(separator, limit); } var startCase = createCompounder(function(result2, word, index) { return result2 + (index ? " " : "") + upperFirst(word); }); function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } function template(string, options, guard) { var settings = lodash.templateSettings; if (guard && isIterateeCall(string, options, guard)) { options = undefined2; } string = toString(string); options = assignInWith({}, options, settings, customDefaultsAssignIn); var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys); var isEscaping, isEvaluating, index = 0, interpolate3 = options.interpolate || reNoMatch, source = "__p += '"; var reDelimiters = RegExp2( (options.escape || reNoMatch).source + "|" + interpolate3.source + "|" + (interpolate3 === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$", "g" ); var sourceURL = "//# sourceURL=" + (hasOwnProperty.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n"; string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset2) { interpolateValue || (interpolateValue = esTemplateValue); source += string.slice(index, offset2).replace(reUnescapedString, escapeStringChar); if (escapeValue) { isEscaping = true; source += "' +\n__e(" + escapeValue + ") +\n'"; } if (evaluateValue) { isEvaluating = true; source += "';\n" + evaluateValue + ";\n__p += '"; } if (interpolateValue) { source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; } index = offset2 + match.length; return match; }); source += "';\n"; var variable = hasOwnProperty.call(options, "variable") && options.variable; if (!variable) { source = "with (obj) {\n" + source + "\n}\n"; } else if (reForbiddenIdentifierChars.test(variable)) { throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT); } source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;"); source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}"; var result2 = attempt(function() { return Function2(importsKeys, sourceURL + "return " + source).apply(undefined2, importsValues); }); result2.source = source; if (isError(result2)) { throw result2; } return result2; } function toLower(value) { return toString(value).toLowerCase(); } function toUpper(value) { return toString(value).toUpperCase(); } function trim(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined2)) { return baseTrim(string); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start4 = charsStartIndex(strSymbols, chrSymbols), end2 = charsEndIndex(strSymbols, chrSymbols) + 1; return castSlice(strSymbols, start4, end2).join(""); } function trimEnd(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined2)) { return string.slice(0, trimmedEndIndex(string) + 1); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), end2 = charsEndIndex(strSymbols, stringToArray(chars)) + 1; return castSlice(strSymbols, 0, end2).join(""); } function trimStart(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined2)) { return string.replace(reTrimStart, ""); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), start4 = charsStartIndex(strSymbols, stringToArray(chars)); return castSlice(strSymbols, start4).join(""); } function truncate(string, options) { var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; if (isObject2(options)) { var separator = "separator" in options ? options.separator : separator; length = "length" in options ? toInteger(options.length) : length; omission = "omission" in options ? baseToString(options.omission) : omission; } string = toString(string); var strLength = string.length; if (hasUnicode(string)) { var strSymbols = stringToArray(string); strLength = strSymbols.length; } if (length >= strLength) { return string; } var end2 = length - stringSize(omission); if (end2 < 1) { return omission; } var result2 = strSymbols ? castSlice(strSymbols, 0, end2).join("") : string.slice(0, end2); if (separator === undefined2) { return result2 + omission; } if (strSymbols) { end2 += result2.length - end2; } if (isRegExp(separator)) { if (string.slice(end2).search(separator)) { var match, substring = result2; if (!separator.global) { separator = RegExp2(separator.source, toString(reFlags.exec(separator)) + "g"); } separator.lastIndex = 0; while (match = separator.exec(substring)) { var newEnd = match.index; } result2 = result2.slice(0, newEnd === undefined2 ? end2 : newEnd); } } else if (string.indexOf(baseToString(separator), end2) != end2) { var index = result2.lastIndexOf(separator); if (index > -1) { result2 = result2.slice(0, index); } } return result2 + omission; } function unescape(string) { string = toString(string); return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; } var upperCase = createCompounder(function(result2, word, index) { return result2 + (index ? " " : "") + word.toUpperCase(); }); var upperFirst = createCaseFirst("toUpperCase"); function words(string, pattern, guard) { string = toString(string); pattern = guard ? undefined2 : pattern; if (pattern === undefined2) { return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } return string.match(pattern) || []; } var attempt = baseRest(function(func, args) { try { return apply(func, undefined2, args); } catch (e) { return isError(e) ? e : new Error2(e); } }); var bindAll = flatRest(function(object, methodNames) { arrayEach(methodNames, function(key) { key = toKey(key); baseAssignValue(object, key, bind(object[key], object)); }); return object; }); function cond(pairs) { var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee(); pairs = !length ? [] : arrayMap(pairs, function(pair) { if (typeof pair[1] != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } return [toIteratee(pair[0]), pair[1]]; }); return baseRest(function(args) { var index = -1; while (++index < length) { var pair = pairs[index]; if (apply(pair[0], this, args)) { return apply(pair[1], this, args); } } }); } function conforms(source) { return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); } function constant(value) { return function() { return value; }; } function defaultTo(value, defaultValue) { return value == null || value !== value ? defaultValue : value; } var flow = createFlow(); var flowRight = createFlow(true); function identity(value) { return value; } function iteratee(func) { return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG)); } function matches(source) { return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); } function matchesProperty(path, srcValue) { return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); } var method = baseRest(function(path, args) { return function(object) { return baseInvoke(object, path, args); }; }); var methodOf = baseRest(function(object, args) { return function(path) { return baseInvoke(object, path, args); }; }); function mixin(object, source, options) { var props = keys(source), methodNames = baseFunctions(source, props); if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) { options = source; source = object; object = this; methodNames = baseFunctions(source, keys(source)); } var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object); arrayEach(methodNames, function(methodName) { var func = source[methodName]; object[methodName] = func; if (isFunc) { object.prototype[methodName] = function() { var chainAll = this.__chain__; if (chain2 || chainAll) { var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__); actions.push({ "func": func, "args": arguments, "thisArg": object }); result2.__chain__ = chainAll; return result2; } return func.apply(object, arrayPush([this.value()], arguments)); }; } }); return object; } function noConflict() { if (root._ === this) { root._ = oldDash; } return this; } function noop2() { } function nthArg(n) { n = toInteger(n); return baseRest(function(args) { return baseNth(args, n); }); } var over = createOver(arrayMap); var overEvery = createOver(arrayEvery); var overSome = createOver(arraySome); function property(path) { return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); } function propertyOf(object) { return function(path) { return object == null ? undefined2 : baseGet(object, path); }; } var range2 = createRange(); var rangeRight = createRange(true); function stubArray() { return []; } function stubFalse() { return false; } function stubObject() { return {}; } function stubString() { return ""; } function stubTrue() { return true; } function times(n, iteratee2) { n = toInteger(n); if (n < 1 || n > MAX_SAFE_INTEGER) { return []; } var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH); iteratee2 = getIteratee(iteratee2); n -= MAX_ARRAY_LENGTH; var result2 = baseTimes(length, iteratee2); while (++index < n) { iteratee2(index); } return result2; } function toPath(value) { if (isArray2(value)) { return arrayMap(value, toKey); } return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); } function uniqueId(prefix) { var id = ++idCounter; return toString(prefix) + id; } var add2 = createMathOperation(function(augend, addend) { return augend + addend; }, 0); var ceil = createRound("ceil"); var divide = createMathOperation(function(dividend, divisor) { return dividend / divisor; }, 1); var floor = createRound("floor"); function max2(array) { return array && array.length ? baseExtremum(array, identity, baseGt) : undefined2; } function maxBy(array, iteratee2) { return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined2; } function mean(array) { return baseMean(array, identity); } function meanBy(array, iteratee2) { return baseMean(array, getIteratee(iteratee2, 2)); } function min2(array) { return array && array.length ? baseExtremum(array, identity, baseLt) : undefined2; } function minBy(array, iteratee2) { return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined2; } var multiply = createMathOperation(function(multiplier, multiplicand) { return multiplier * multiplicand; }, 1); var round2 = createRound("round"); var subtract = createMathOperation(function(minuend, subtrahend) { return minuend - subtrahend; }, 0); function sum(array) { return array && array.length ? baseSum(array, identity) : 0; } function sumBy(array, iteratee2) { return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0; } lodash.after = after; lodash.ary = ary; lodash.assign = assign; lodash.assignIn = assignIn; lodash.assignInWith = assignInWith; lodash.assignWith = assignWith; lodash.at = at; lodash.before = before; lodash.bind = bind; lodash.bindAll = bindAll; lodash.bindKey = bindKey; lodash.castArray = castArray; lodash.chain = chain; lodash.chunk = chunk; lodash.compact = compact2; lodash.concat = concat; lodash.cond = cond; lodash.conforms = conforms; lodash.constant = constant; lodash.countBy = countBy; lodash.create = create; lodash.curry = curry; lodash.curryRight = curryRight; lodash.debounce = debounce3; lodash.defaults = defaults; lodash.defaultsDeep = defaultsDeep; lodash.defer = defer; lodash.delay = delay; lodash.difference = difference; lodash.differenceBy = differenceBy; lodash.differenceWith = differenceWith; lodash.drop = drop; lodash.dropRight = dropRight; lodash.dropRightWhile = dropRightWhile; lodash.dropWhile = dropWhile; lodash.fill = fill; lodash.filter = filter; lodash.flatMap = flatMap; lodash.flatMapDeep = flatMapDeep; lodash.flatMapDepth = flatMapDepth; lodash.flatten = flatten; lodash.flattenDeep = flattenDeep2; lodash.flattenDepth = flattenDepth; lodash.flip = flip2; lodash.flow = flow; lodash.flowRight = flowRight; lodash.fromPairs = fromPairs; lodash.functions = functions; lodash.functionsIn = functionsIn; lodash.groupBy = groupBy; lodash.initial = initial; lodash.intersection = intersection; lodash.intersectionBy = intersectionBy; lodash.intersectionWith = intersectionWith; lodash.invert = invert; lodash.invertBy = invertBy; lodash.invokeMap = invokeMap; lodash.iteratee = iteratee; lodash.keyBy = keyBy; lodash.keys = keys; lodash.keysIn = keysIn; lodash.map = map; lodash.mapKeys = mapKeys; lodash.mapValues = mapValues; lodash.matches = matches; lodash.matchesProperty = matchesProperty; lodash.memoize = memoize; lodash.merge = merge; lodash.mergeWith = mergeWith; lodash.method = method; lodash.methodOf = methodOf; lodash.mixin = mixin; lodash.negate = negate; lodash.nthArg = nthArg; lodash.omit = omit; lodash.omitBy = omitBy; lodash.once = once; lodash.orderBy = orderBy; lodash.over = over; lodash.overArgs = overArgs; lodash.overEvery = overEvery; lodash.overSome = overSome; lodash.partial = partial; lodash.partialRight = partialRight; lodash.partition = partition; lodash.pick = pick; lodash.pickBy = pickBy; lodash.property = property; lodash.propertyOf = propertyOf; lodash.pull = pull; lodash.pullAll = pullAll; lodash.pullAllBy = pullAllBy; lodash.pullAllWith = pullAllWith; lodash.pullAt = pullAt; lodash.range = range2; lodash.rangeRight = rangeRight; lodash.rearg = rearg; lodash.reject = reject; lodash.remove = remove; lodash.rest = rest; lodash.reverse = reverse; lodash.sampleSize = sampleSize; lodash.set = set2; lodash.setWith = setWith; lodash.shuffle = shuffle; lodash.slice = slice; lodash.sortBy = sortBy2; lodash.sortedUniq = sortedUniq; lodash.sortedUniqBy = sortedUniqBy; lodash.split = split; lodash.spread = spread; lodash.tail = tail; lodash.take = take; lodash.takeRight = takeRight; lodash.takeRightWhile = takeRightWhile; lodash.takeWhile = takeWhile; lodash.tap = tap; lodash.throttle = throttle; lodash.thru = thru; lodash.toArray = toArray; lodash.toPairs = toPairs; lodash.toPairsIn = toPairsIn; lodash.toPath = toPath; lodash.toPlainObject = toPlainObject; lodash.transform = transform; lodash.unary = unary; lodash.union = union; lodash.unionBy = unionBy; lodash.unionWith = unionWith; lodash.uniq = uniq2; lodash.uniqBy = uniqBy; lodash.uniqWith = uniqWith; lodash.unset = unset; lodash.unzip = unzip; lodash.unzipWith = unzipWith; lodash.update = update; lodash.updateWith = updateWith; lodash.values = values; lodash.valuesIn = valuesIn; lodash.without = without; lodash.words = words; lodash.wrap = wrap; lodash.xor = xor; lodash.xorBy = xorBy; lodash.xorWith = xorWith; lodash.zip = zip2; lodash.zipObject = zipObject2; lodash.zipObjectDeep = zipObjectDeep; lodash.zipWith = zipWith; lodash.entries = toPairs; lodash.entriesIn = toPairsIn; lodash.extend = assignIn; lodash.extendWith = assignInWith; mixin(lodash, lodash); lodash.add = add2; lodash.attempt = attempt; lodash.camelCase = camelCase2; lodash.capitalize = capitalize2; lodash.ceil = ceil; lodash.clamp = clamp; lodash.clone = clone; lodash.cloneDeep = cloneDeep; lodash.cloneDeepWith = cloneDeepWith; lodash.cloneWith = cloneWith; lodash.conformsTo = conformsTo; lodash.deburr = deburr; lodash.defaultTo = defaultTo; lodash.divide = divide; lodash.endsWith = endsWith; lodash.eq = eq; lodash.escape = escape2; lodash.escapeRegExp = escapeRegExp; lodash.every = every; lodash.find = find; lodash.findIndex = findIndex; lodash.findKey = findKey; lodash.findLast = findLast; lodash.findLastIndex = findLastIndex; lodash.findLastKey = findLastKey; lodash.floor = floor; lodash.forEach = forEach; lodash.forEachRight = forEachRight; lodash.forIn = forIn; lodash.forInRight = forInRight; lodash.forOwn = forOwn; lodash.forOwnRight = forOwnRight; lodash.get = get4; lodash.gt = gt; lodash.gte = gte; lodash.has = has2; lodash.hasIn = hasIn; lodash.head = head; lodash.identity = identity; lodash.includes = includes; lodash.indexOf = indexOf2; lodash.inRange = inRange; lodash.invoke = invoke; lodash.isArguments = isArguments; lodash.isArray = isArray2; lodash.isArrayBuffer = isArrayBuffer; lodash.isArrayLike = isArrayLike; lodash.isArrayLikeObject = isArrayLikeObject; lodash.isBoolean = isBoolean; lodash.isBuffer = isBuffer; lodash.isDate = isDate; lodash.isElement = isElement3; lodash.isEmpty = isEmpty; lodash.isEqual = isEqual; lodash.isEqualWith = isEqualWith; lodash.isError = isError; lodash.isFinite = isFinite2; lodash.isFunction = isFunction; lodash.isInteger = isInteger; lodash.isLength = isLength; lodash.isMap = isMap; lodash.isMatch = isMatch; lodash.isMatchWith = isMatchWith; lodash.isNaN = isNaN2; lodash.isNative = isNative; lodash.isNil = isNil; lodash.isNull = isNull; lodash.isNumber = isNumber; lodash.isObject = isObject2; lodash.isObjectLike = isObjectLike; lodash.isPlainObject = isPlainObject; lodash.isRegExp = isRegExp; lodash.isSafeInteger = isSafeInteger; lodash.isSet = isSet2; lodash.isString = isString; lodash.isSymbol = isSymbol; lodash.isTypedArray = isTypedArray; lodash.isUndefined = isUndefined; lodash.isWeakMap = isWeakMap; lodash.isWeakSet = isWeakSet; lodash.join = join; lodash.kebabCase = kebabCase; lodash.last = last; lodash.lastIndexOf = lastIndexOf; lodash.lowerCase = lowerCase; lodash.lowerFirst = lowerFirst; lodash.lt = lt; lodash.lte = lte; lodash.max = max2; lodash.maxBy = maxBy; lodash.mean = mean; lodash.meanBy = meanBy; lodash.min = min2; lodash.minBy = minBy; lodash.stubArray = stubArray; lodash.stubFalse = stubFalse; lodash.stubObject = stubObject; lodash.stubString = stubString; lodash.stubTrue = stubTrue; lodash.multiply = multiply; lodash.nth = nth; lodash.noConflict = noConflict; lodash.noop = noop2; lodash.now = now2; lodash.pad = pad; lodash.padEnd = padEnd; lodash.padStart = padStart; lodash.parseInt = parseInt2; lodash.random = random; lodash.reduce = reduce; lodash.reduceRight = reduceRight; lodash.repeat = repeat2; lodash.replace = replace; lodash.result = result; lodash.round = round2; lodash.runInContext = runInContext2; lodash.sample = sample; lodash.size = size; lodash.snakeCase = snakeCase; lodash.some = some; lodash.sortedIndex = sortedIndex; lodash.sortedIndexBy = sortedIndexBy; lodash.sortedIndexOf = sortedIndexOf; lodash.sortedLastIndex = sortedLastIndex; lodash.sortedLastIndexBy = sortedLastIndexBy; lodash.sortedLastIndexOf = sortedLastIndexOf; lodash.startCase = startCase; lodash.startsWith = startsWith; lodash.subtract = subtract; lodash.sum = sum; lodash.sumBy = sumBy; lodash.template = template; lodash.times = times; lodash.toFinite = toFinite; lodash.toInteger = toInteger; lodash.toLength = toLength; lodash.toLower = toLower; lodash.toNumber = toNumber; lodash.toSafeInteger = toSafeInteger; lodash.toString = toString; lodash.toUpper = toUpper; lodash.trim = trim; lodash.trimEnd = trimEnd; lodash.trimStart = trimStart; lodash.truncate = truncate; lodash.unescape = unescape; lodash.uniqueId = uniqueId; lodash.upperCase = upperCase; lodash.upperFirst = upperFirst; lodash.each = forEach; lodash.eachRight = forEachRight; lodash.first = head; mixin(lodash, function() { var source = {}; baseForOwn(lodash, function(func, methodName) { if (!hasOwnProperty.call(lodash.prototype, methodName)) { source[methodName] = func; } }); return source; }(), { "chain": false }); lodash.VERSION = VERSION2; arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) { lodash[methodName].placeholder = lodash; }); arrayEach(["drop", "take"], function(methodName, index) { LazyWrapper.prototype[methodName] = function(n) { n = n === undefined2 ? 1 : nativeMax(toInteger(n), 0); var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone(); if (result2.__filtered__) { result2.__takeCount__ = nativeMin(n, result2.__takeCount__); } else { result2.__views__.push({ "size": nativeMin(n, MAX_ARRAY_LENGTH), "type": methodName + (result2.__dir__ < 0 ? "Right" : "") }); } return result2; }; LazyWrapper.prototype[methodName + "Right"] = function(n) { return this.reverse()[methodName](n).reverse(); }; }); arrayEach(["filter", "map", "takeWhile"], function(methodName, index) { var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; LazyWrapper.prototype[methodName] = function(iteratee2) { var result2 = this.clone(); result2.__iteratees__.push({ "iteratee": getIteratee(iteratee2, 3), "type": type }); result2.__filtered__ = result2.__filtered__ || isFilter; return result2; }; }); arrayEach(["head", "last"], function(methodName, index) { var takeName = "take" + (index ? "Right" : ""); LazyWrapper.prototype[methodName] = function() { return this[takeName](1).value()[0]; }; }); arrayEach(["initial", "tail"], function(methodName, index) { var dropName = "drop" + (index ? "" : "Right"); LazyWrapper.prototype[methodName] = function() { return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); }; }); LazyWrapper.prototype.compact = function() { return this.filter(identity); }; LazyWrapper.prototype.find = function(predicate) { return this.filter(predicate).head(); }; LazyWrapper.prototype.findLast = function(predicate) { return this.reverse().find(predicate); }; LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { if (typeof path == "function") { return new LazyWrapper(this); } return this.map(function(value) { return baseInvoke(value, path, args); }); }); LazyWrapper.prototype.reject = function(predicate) { return this.filter(negate(getIteratee(predicate))); }; LazyWrapper.prototype.slice = function(start4, end2) { start4 = toInteger(start4); var result2 = this; if (result2.__filtered__ && (start4 > 0 || end2 < 0)) { return new LazyWrapper(result2); } if (start4 < 0) { result2 = result2.takeRight(-start4); } else if (start4) { result2 = result2.drop(start4); } if (end2 !== undefined2) { end2 = toInteger(end2); result2 = end2 < 0 ? result2.dropRight(-end2) : result2.take(end2 - start4); } return result2; }; LazyWrapper.prototype.takeRightWhile = function(predicate) { return this.reverse().takeWhile(predicate).reverse(); }; LazyWrapper.prototype.toArray = function() { return this.take(MAX_ARRAY_LENGTH); }; baseForOwn(LazyWrapper.prototype, function(func, methodName) { var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName); if (!lodashFunc) { return; } lodash.prototype[methodName] = function() { var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray2(value); var interceptor = function(value2) { var result3 = lodashFunc.apply(lodash, arrayPush([value2], args)); return isTaker && chainAll ? result3[0] : result3; }; if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) { isLazy = useLazy = false; } var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid; if (!retUnwrapped && useLazy) { value = onlyLazy ? value : new LazyWrapper(this); var result2 = func.apply(value, args); result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined2 }); return new LodashWrapper(result2, chainAll); } if (isUnwrapped && onlyLazy) { return func.apply(this, args); } result2 = this.thru(interceptor); return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2; }; }); arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) { var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName); lodash.prototype[methodName] = function() { var args = arguments; if (retUnwrapped && !this.__chain__) { var value = this.value(); return func.apply(isArray2(value) ? value : [], args); } return this[chainName](function(value2) { return func.apply(isArray2(value2) ? value2 : [], args); }); }; }); baseForOwn(LazyWrapper.prototype, function(func, methodName) { var lodashFunc = lodash[methodName]; if (lodashFunc) { var key = lodashFunc.name + ""; if (!hasOwnProperty.call(realNames, key)) { realNames[key] = []; } realNames[key].push({ "name": methodName, "func": lodashFunc }); } }); realNames[createHybrid(undefined2, WRAP_BIND_KEY_FLAG).name] = [{ "name": "wrapper", "func": undefined2 }]; LazyWrapper.prototype.clone = lazyClone; LazyWrapper.prototype.reverse = lazyReverse; LazyWrapper.prototype.value = lazyValue; lodash.prototype.at = wrapperAt; lodash.prototype.chain = wrapperChain; lodash.prototype.commit = wrapperCommit; lodash.prototype.next = wrapperNext; lodash.prototype.plant = wrapperPlant; lodash.prototype.reverse = wrapperReverse; lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; lodash.prototype.first = lodash.prototype.head; if (symIterator) { lodash.prototype[symIterator] = wrapperToIterator; } return lodash; }; var _ = runInContext(); if (typeof define == "function" && typeof define.amd == "object" && define.amd) { root._ = _; define(function() { return _; }); } else if (freeModule) { (freeModule.exports = _)._ = _; freeExports._ = _; } else { root._ = _; } }).call(exports); } }); // node_modules/bignumber.js/bignumber.js var require_bignumber = __commonJS({ "node_modules/bignumber.js/bignumber.js"(exports, module) { (function(globalObject) { "use strict"; var BigNumber7, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9; function clone(configObject) { var div, convertBase, parseNumeric, P = BigNumber8.prototype = { constructor: BigNumber8, toString: null, valueOf: null }, ONE = new BigNumber8(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = { prefix: "", groupSize: 3, secondaryGroupSize: 0, groupSeparator: ",", decimalSeparator: ".", fractionGroupSize: 0, fractionGroupSeparator: "\xA0", // non-breaking space suffix: "" }, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true; function BigNumber8(v, b) { var alphabet, c, caseChanged, e, i, isNum, len, str, x = this; if (!(x instanceof BigNumber8)) return new BigNumber8(v, b); if (b == null) { if (v && v._isBigNumber === true) { x.s = v.s; if (!v.c || v.e > MAX_EXP) { x.c = x.e = null; } else if (v.e < MIN_EXP) { x.c = [x.e = 0]; } else { x.e = v.e; x.c = v.c.slice(); } return; } if ((isNum = typeof v == "number") && v * 0 == 0) { x.s = 1 / v < 0 ? (v = -v, -1) : 1; if (v === ~~v) { for (e = 0, i = v; i >= 10; i /= 10, e++) ; if (e > MAX_EXP) { x.c = x.e = null; } else { x.e = e; x.c = [v]; } return; } str = String(v); } else { if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum); x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; } if ((e = str.indexOf(".")) > -1) str = str.replace(".", ""); if ((i = str.search(/e/i)) > 0) { if (e < 0) e = i; e += +str.slice(i + 1); str = str.substring(0, i); } else if (e < 0) { e = str.length; } } else { intCheck(b, 2, ALPHABET.length, "Base"); if (b == 10 && alphabetHasNormalDecimalDigits) { x = new BigNumber8(v); return round2(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); } str = String(v); if (isNum = typeof v == "number") { if (v * 0 != 0) return parseNumeric(x, str, isNum, b); x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1; if (BigNumber8.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) { throw Error(tooManyDigits + v); } } else { x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; } alphabet = ALPHABET.slice(0, b); e = i = 0; for (len = str.length; i < len; i++) { if (alphabet.indexOf(c = str.charAt(i)) < 0) { if (c == ".") { if (i > e) { e = len; continue; } } else if (!caseChanged) { if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) { caseChanged = true; i = -1; e = 0; continue; } } return parseNumeric(x, String(v), isNum, b); } } isNum = false; str = convertBase(str, b, 10, x.s); if ((e = str.indexOf(".")) > -1) str = str.replace(".", ""); else e = str.length; } for (i = 0; str.charCodeAt(i) === 48; i++) ; for (len = str.length; str.charCodeAt(--len) === 48; ) ; if (str = str.slice(i, ++len)) { len -= i; if (isNum && BigNumber8.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) { throw Error(tooManyDigits + x.s * v); } if ((e = e - i - 1) > MAX_EXP) { x.c = x.e = null; } else if (e < MIN_EXP) { x.c = [x.e = 0]; } else { x.e = e; x.c = []; i = (e + 1) % LOG_BASE; if (e < 0) i += LOG_BASE; if (i < len) { if (i) x.c.push(+str.slice(0, i)); for (len -= LOG_BASE; i < len; ) { x.c.push(+str.slice(i, i += LOG_BASE)); } i = LOG_BASE - (str = str.slice(i)).length; } else { i -= len; } for (; i--; str += "0") ; x.c.push(+str); } } else { x.c = [x.e = 0]; } } BigNumber8.clone = clone; BigNumber8.ROUND_UP = 0; BigNumber8.ROUND_DOWN = 1; BigNumber8.ROUND_CEIL = 2; BigNumber8.ROUND_FLOOR = 3; BigNumber8.ROUND_HALF_UP = 4; BigNumber8.ROUND_HALF_DOWN = 5; BigNumber8.ROUND_HALF_EVEN = 6; BigNumber8.ROUND_HALF_CEIL = 7; BigNumber8.ROUND_HALF_FLOOR = 8; BigNumber8.EUCLID = 9; BigNumber8.config = BigNumber8.set = function(obj) { var p, v; if (obj != null) { if (typeof obj == "object") { if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) { v = obj[p]; intCheck(v, 0, MAX, p); DECIMAL_PLACES = v; } if (obj.hasOwnProperty(p = "ROUNDING_MODE")) { v = obj[p]; intCheck(v, 0, 8, p); ROUNDING_MODE = v; } if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) { v = obj[p]; if (v && v.pop) { intCheck(v[0], -MAX, 0, p); intCheck(v[1], 0, MAX, p); TO_EXP_NEG = v[0]; TO_EXP_POS = v[1]; } else { intCheck(v, -MAX, MAX, p); TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); } } if (obj.hasOwnProperty(p = "RANGE")) { v = obj[p]; if (v && v.pop) { intCheck(v[0], -MAX, -1, p); intCheck(v[1], 1, MAX, p); MIN_EXP = v[0]; MAX_EXP = v[1]; } else { intCheck(v, -MAX, MAX, p); if (v) { MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); } else { throw Error(bignumberError + p + " cannot be zero: " + v); } } } if (obj.hasOwnProperty(p = "CRYPTO")) { v = obj[p]; if (v === !!v) { if (v) { if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) { CRYPTO = v; } else { CRYPTO = !v; throw Error(bignumberError + "crypto unavailable"); } } else { CRYPTO = v; } } else { throw Error(bignumberError + p + " not true or false: " + v); } } if (obj.hasOwnProperty(p = "MODULO_MODE")) { v = obj[p]; intCheck(v, 0, 9, p); MODULO_MODE = v; } if (obj.hasOwnProperty(p = "POW_PRECISION")) { v = obj[p]; intCheck(v, 0, MAX, p); POW_PRECISION = v; } if (obj.hasOwnProperty(p = "FORMAT")) { v = obj[p]; if (typeof v == "object") FORMAT = v; else throw Error(bignumberError + p + " not an object: " + v); } if (obj.hasOwnProperty(p = "ALPHABET")) { v = obj[p]; if (typeof v == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) { alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789"; ALPHABET = v; } else { throw Error(bignumberError + p + " invalid: " + v); } } } else { throw Error(bignumberError + "Object expected: " + obj); } } return { DECIMAL_PLACES, ROUNDING_MODE, EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], RANGE: [MIN_EXP, MAX_EXP], CRYPTO, MODULO_MODE, POW_PRECISION, FORMAT, ALPHABET }; }; BigNumber8.isBigNumber = function(v) { if (!v || v._isBigNumber !== true) return false; if (!BigNumber8.DEBUG) return true; var i, n, c = v.c, e = v.e, s = v.s; out: if ({}.toString.call(c) == "[object Array]") { if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) { if (c[0] === 0) { if (e === 0 && c.length === 1) return true; break out; } i = (e + 1) % LOG_BASE; if (i < 1) i += LOG_BASE; if (String(c[0]).length == i) { for (i = 0; i < c.length; i++) { n = c[i]; if (n < 0 || n >= BASE || n !== mathfloor(n)) break out; } if (n !== 0) return true; } } } else if (c === null && e === null && (s === null || s === 1 || s === -1)) { return true; } throw Error(bignumberError + "Invalid BigNumber: " + v); }; BigNumber8.maximum = BigNumber8.max = function() { return maxOrMin(arguments, P.lt); }; BigNumber8.minimum = BigNumber8.min = function() { return maxOrMin(arguments, P.gt); }; BigNumber8.random = function() { var pow2_53 = 9007199254740992; var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() { return mathfloor(Math.random() * pow2_53); } : function() { return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0); }; return function(dp) { var a, b, e, k, v, i = 0, c = [], rand = new BigNumber8(ONE); if (dp == null) dp = DECIMAL_PLACES; else intCheck(dp, 0, MAX); k = mathceil(dp / LOG_BASE); if (CRYPTO) { if (crypto.getRandomValues) { a = crypto.getRandomValues(new Uint32Array(k *= 2)); for (; i < k; ) { v = a[i] * 131072 + (a[i + 1] >>> 11); if (v >= 9e15) { b = crypto.getRandomValues(new Uint32Array(2)); a[i] = b[0]; a[i + 1] = b[1]; } else { c.push(v % 1e14); i += 2; } } i = k / 2; } else if (crypto.randomBytes) { a = crypto.randomBytes(k *= 7); for (; i < k; ) { v = (a[i] & 31) * 281474976710656 + a[i + 1] * 1099511627776 + a[i + 2] * 4294967296 + a[i + 3] * 16777216 + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; if (v >= 9e15) { crypto.randomBytes(7).copy(a, i); } else { c.push(v % 1e14); i += 7; } } i = k / 7; } else { CRYPTO = false; throw Error(bignumberError + "crypto unavailable"); } } if (!CRYPTO) { for (; i < k; ) { v = random53bitInt(); if (v < 9e15) c[i++] = v % 1e14; } } k = c[--i]; dp %= LOG_BASE; if (k && dp) { v = POWS_TEN[LOG_BASE - dp]; c[i] = mathfloor(k / v) * v; } for (; c[i] === 0; c.pop(), i--) ; if (i < 0) { c = [e = 0]; } else { for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ; for (i = 1, v = c[0]; v >= 10; v /= 10, i++) ; if (i < LOG_BASE) e -= LOG_BASE - i; } rand.e = e; rand.c = c; return rand; }; }(); BigNumber8.sum = function() { var i = 1, args = arguments, sum = new BigNumber8(args[0]); for (; i < args.length; ) sum = sum.plus(args[i++]); return sum; }; convertBase = function() { var decimal = "0123456789"; function toBaseOut(str, baseIn, baseOut, alphabet) { var j, arr = [0], arrL, i = 0, len = str.length; for (; i < len; ) { for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ; arr[0] += alphabet.indexOf(str.charAt(i++)); for (j = 0; j < arr.length; j++) { if (arr[j] > baseOut - 1) { if (arr[j + 1] == null) arr[j + 1] = 0; arr[j + 1] += arr[j] / baseOut | 0; arr[j] %= baseOut; } } } return arr.reverse(); } return function(str, baseIn, baseOut, sign, callerIsToString) { var alphabet, d, e, k, r, x, xc, y, i = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE; if (i >= 0) { k = POW_PRECISION; POW_PRECISION = 0; str = str.replace(".", ""); y = new BigNumber8(baseIn); x = y.pow(str.length - i); POW_PRECISION = k; y.c = toBaseOut( toFixedPoint(coeffToString(x.c), x.e, "0"), 10, baseOut, decimal ); y.e = y.c.length; } xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET)); e = k = xc.length; for (; xc[--k] == 0; xc.pop()) ; if (!xc[0]) return alphabet.charAt(0); if (i < 0) { --e; } else { x.c = xc; x.e = e; x.s = sign; x = div(x, y, dp, rm, baseOut); xc = x.c; r = x.r; e = x.e; } d = e + dp + 1; i = xc[d]; k = baseOut / 2; r = r || d < 0 || xc[d + 1] != null; r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7)); if (d < 1 || !xc[0]) { str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0); } else { xc.length = d; if (r) { for (--baseOut; ++xc[--d] > baseOut; ) { xc[d] = 0; if (!d) { ++e; xc = [1].concat(xc); } } } for (k = xc.length; !xc[--k]; ) ; for (i = 0, str = ""; i <= k; str += alphabet.charAt(xc[i++])) ; str = toFixedPoint(str, e, alphabet.charAt(0)); } return str; }; }(); div = function() { function multiply(x, k, base) { var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0; for (x = x.slice(); i--; ) { xlo = x[i] % SQRT_BASE; xhi = x[i] / SQRT_BASE | 0; m = khi * xlo + xhi * klo; temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry; carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; x[i] = temp % base; } if (carry) x = [carry].concat(x); return x; } function compare2(a, b, aL, bL) { var i, cmp; if (aL != bL) { cmp = aL > bL ? 1 : -1; } else { for (i = cmp = 0; i < aL; i++) { if (a[i] != b[i]) { cmp = a[i] > b[i] ? 1 : -1; break; } } } return cmp; } function subtract(a, b, aL, base) { var i = 0; for (; aL--; ) { a[aL] -= i; i = a[aL] < b[aL] ? 1 : 0; a[aL] = i * base + a[aL] - b[aL]; } for (; !a[0] && a.length > 1; a.splice(0, 1)) ; } return function(x, y, dp, rm, base) { var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c; if (!xc || !xc[0] || !yc || !yc[0]) { return new BigNumber8( // Return NaN if either NaN, or both Infinity or 0. !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : ( // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. xc && xc[0] == 0 || !yc ? s * 0 : s / 0 ) ); } q = new BigNumber8(s); qc = q.c = []; e = x.e - y.e; s = dp + e + 1; if (!base) { base = BASE; e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); s = s / LOG_BASE | 0; } for (i = 0; yc[i] == (xc[i] || 0); i++) ; if (yc[i] > (xc[i] || 0)) e--; if (s < 0) { qc.push(1); more = true; } else { xL = xc.length; yL = yc.length; i = 0; s += 2; n = mathfloor(base / (yc[0] + 1)); if (n > 1) { yc = multiply(yc, n, base); xc = multiply(xc, n, base); yL = yc.length; xL = xc.length; } xi = yL; rem = xc.slice(0, yL); remL = rem.length; for (; remL < yL; rem[remL++] = 0) ; yz = yc.slice(); yz = [0].concat(yz); yc0 = yc[0]; if (yc[1] >= base / 2) yc0++; do { n = 0; cmp = compare2(yc, rem, yL, remL); if (cmp < 0) { rem0 = rem[0]; if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); n = mathfloor(rem0 / yc0); if (n > 1) { if (n >= base) n = base - 1; prod = multiply(yc, n, base); prodL = prod.length; remL = rem.length; while (compare2(prod, rem, prodL, remL) == 1) { n--; subtract(prod, yL < prodL ? yz : yc, prodL, base); prodL = prod.length; cmp = 1; } } else { if (n == 0) { cmp = n = 1; } prod = yc.slice(); prodL = prod.length; } if (prodL < remL) prod = [0].concat(prod); subtract(rem, prod, remL, base); remL = rem.length; if (cmp == -1) { while (compare2(yc, rem, yL, remL) < 1) { n++; subtract(rem, yL < remL ? yz : yc, remL, base); remL = rem.length; } } } else if (cmp === 0) { n++; rem = [0]; } qc[i++] = n; if (rem[0]) { rem[remL++] = xc[xi] || 0; } else { rem = [xc[xi]]; remL = 1; } } while ((xi++ < xL || rem[0] != null) && s--); more = rem[0] != null; if (!qc[0]) qc.splice(0, 1); } if (base == BASE) { for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ; round2(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); } else { q.e = e; q.r = +more; } return q; }; }(); function format(n, i, rm, id) { var c0, e, ne, len, str; if (rm == null) rm = ROUNDING_MODE; else intCheck(rm, 0, 8); if (!n.c) return n.toString(); c0 = n.c[0]; ne = n.e; if (i == null) { str = coeffToString(n.c); str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0"); } else { n = round2(new BigNumber8(n), i, rm); e = n.e; str = coeffToString(n.c); len = str.length; if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { for (; len < i; str += "0", len++) ; str = toExponential(str, e); } else { i -= ne; str = toFixedPoint(str, e, "0"); if (e + 1 > len) { if (--i > 0) for (str += "."; i--; str += "0") ; } else { i += e - len; if (i > 0) { if (e + 1 == len) str += "."; for (; i--; str += "0") ; } } } } return n.s < 0 && c0 ? "-" + str : str; } function maxOrMin(args, method) { var n, i = 1, m = new BigNumber8(args[0]); for (; i < args.length; i++) { n = new BigNumber8(args[i]); if (!n.s) { m = n; break; } else if (method.call(m, n)) { m = n; } } return m; } function normalise(n, c, e) { var i = 1, j = c.length; for (; !c[--j]; c.pop()) ; for (j = c[0]; j >= 10; j /= 10, i++) ; if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { n.c = n.e = null; } else if (e < MIN_EXP) { n.c = [n.e = 0]; } else { n.e = e; n.c = c; } return n; } parseNumeric = function() { var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; return function(x, str, isNum, b) { var base, s = isNum ? str : str.replace(whitespaceOrPlus, ""); if (isInfinityOrNaN.test(s)) { x.s = isNaN(s) ? null : s < 0 ? -1 : 1; } else { if (!isNum) { s = s.replace(basePrefix, function(m, p1, p2) { base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8; return !b || b == base ? p1 : m; }); if (b) { base = b; s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1"); } if (str != s) return new BigNumber8(s, base); } if (BigNumber8.DEBUG) { throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str); } x.s = null; } x.c = x.e = null; }; }(); function round2(x, sd, rm, r) { var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN; if (xc) { out: { for (d = 1, k = xc[0]; k >= 10; k /= 10, d++) ; i = sd - d; if (i < 0) { i += LOG_BASE; j = sd; n = xc[ni = 0]; rd = n / pows10[d - j - 1] % 10 | 0; } else { ni = mathceil((i + 1) / LOG_BASE); if (ni >= xc.length) { if (r) { for (; xc.length <= ni; xc.push(0)) ; n = rd = 0; d = 1; i %= LOG_BASE; j = i - LOG_BASE + 1; } else { break out; } } else { n = k = xc[ni]; for (d = 1; k >= 10; k /= 10, d++) ; i %= LOG_BASE; j = i - LOG_BASE + d; rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; } } r = r || sd < 0 || // Are there any non-zero digits after the rounding digit? // The expression n % pows10[d - j - 1] returns all digits of n to the right // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); r = rm < 4 ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && // Check whether the digit to the left of the rounding digit is odd. (i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7)); if (sd < 1 || !xc[0]) { xc.length = 0; if (r) { sd -= x.e + 1; xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; x.e = -sd || 0; } else { xc[0] = x.e = 0; } return x; } if (i == 0) { xc.length = ni; k = 1; ni--; } else { xc.length = ni + 1; k = pows10[LOG_BASE - i]; xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; } if (r) { for (; ; ) { if (ni == 0) { for (i = 1, j = xc[0]; j >= 10; j /= 10, i++) ; j = xc[0] += k; for (k = 1; j >= 10; j /= 10, k++) ; if (i != k) { x.e++; if (xc[0] == BASE) xc[0] = 1; } break; } else { xc[ni] += k; if (xc[ni] != BASE) break; xc[ni--] = 0; k = 1; } } } for (i = xc.length; xc[--i] === 0; xc.pop()) ; } if (x.e > MAX_EXP) { x.c = x.e = null; } else if (x.e < MIN_EXP) { x.c = [x.e = 0]; } } return x; } function valueOf(n) { var str, e = n.e; if (e === null) return n.toString(); str = coeffToString(n.c); str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0"); return n.s < 0 ? "-" + str : str; } P.absoluteValue = P.abs = function() { var x = new BigNumber8(this); if (x.s < 0) x.s = 1; return x; }; P.comparedTo = function(y, b) { return compare(this, new BigNumber8(y, b)); }; P.decimalPlaces = P.dp = function(dp, rm) { var c, n, v, x = this; if (dp != null) { intCheck(dp, 0, MAX); if (rm == null) rm = ROUNDING_MODE; else intCheck(rm, 0, 8); return round2(new BigNumber8(x), dp + x.e + 1, rm); } if (!(c = x.c)) return null; n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; if (v = c[v]) for (; v % 10 == 0; v /= 10, n--) ; if (n < 0) n = 0; return n; }; P.dividedBy = P.div = function(y, b) { return div(this, new BigNumber8(y, b), DECIMAL_PLACES, ROUNDING_MODE); }; P.dividedToIntegerBy = P.idiv = function(y, b) { return div(this, new BigNumber8(y, b), 0, 1); }; P.exponentiatedBy = P.pow = function(n, m) { var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this; n = new BigNumber8(n); if (n.c && !n.isInteger()) { throw Error(bignumberError + "Exponent not an integer: " + valueOf(n)); } if (m != null) m = new BigNumber8(m); nIsBig = n.e > 14; if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { y = new BigNumber8(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n))); return m ? y.mod(m) : y; } nIsNeg = n.s < 0; if (m) { if (m.c ? !m.c[0] : !m.s) return new BigNumber8(NaN); isModExp = !nIsNeg && x.isInteger() && m.isInteger(); if (isModExp) x = x.mod(m); } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { k = x.s < 0 && isOdd(n) ? -0 : 0; if (x.e > -1) k = 1 / k; return new BigNumber8(nIsNeg ? 1 / k : k); } else if (POW_PRECISION) { k = mathceil(POW_PRECISION / LOG_BASE + 2); } if (nIsBig) { half = new BigNumber8(0.5); if (nIsNeg) n.s = 1; nIsOdd = isOdd(n); } else { i = Math.abs(+valueOf(n)); nIsOdd = i % 2; } y = new BigNumber8(ONE); for (; ; ) { if (nIsOdd) { y = y.times(x); if (!y.c) break; if (k) { if (y.c.length > k) y.c.length = k; } else if (isModExp) { y = y.mod(m); } } if (i) { i = mathfloor(i / 2); if (i === 0) break; nIsOdd = i % 2; } else { n = n.times(half); round2(n, n.e + 1, 1); if (n.e > 14) { nIsOdd = isOdd(n); } else { i = +valueOf(n); if (i === 0) break; nIsOdd = i % 2; } } x = x.times(x); if (k) { if (x.c && x.c.length > k) x.c.length = k; } else if (isModExp) { x = x.mod(m); } } if (isModExp) return y; if (nIsNeg) y = ONE.div(y); return m ? y.mod(m) : k ? round2(y, POW_PRECISION, ROUNDING_MODE, more) : y; }; P.integerValue = function(rm) { var n = new BigNumber8(this); if (rm == null) rm = ROUNDING_MODE; else intCheck(rm, 0, 8); return round2(n, n.e + 1, rm); }; P.isEqualTo = P.eq = function(y, b) { return compare(this, new BigNumber8(y, b)) === 0; }; P.isFinite = function() { return !!this.c; }; P.isGreaterThan = P.gt = function(y, b) { return compare(this, new BigNumber8(y, b)) > 0; }; P.isGreaterThanOrEqualTo = P.gte = function(y, b) { return (b = compare(this, new BigNumber8(y, b))) === 1 || b === 0; }; P.isInteger = function() { return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; }; P.isLessThan = P.lt = function(y, b) { return compare(this, new BigNumber8(y, b)) < 0; }; P.isLessThanOrEqualTo = P.lte = function(y, b) { return (b = compare(this, new BigNumber8(y, b))) === -1 || b === 0; }; P.isNaN = function() { return !this.s; }; P.isNegative = function() { return this.s < 0; }; P.isPositive = function() { return this.s > 0; }; P.isZero = function() { return !!this.c && this.c[0] == 0; }; P.minus = function(y, b) { var i, j, t, xLTy, x = this, a = x.s; y = new BigNumber8(y, b); b = y.s; if (!a || !b) return new BigNumber8(NaN); if (a != b) { y.s = -b; return x.plus(y); } var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c; if (!xe || !ye) { if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber8(yc ? x : NaN); if (!xc[0] || !yc[0]) { return yc[0] ? (y.s = -b, y) : new BigNumber8(xc[0] ? x : ( // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity ROUNDING_MODE == 3 ? -0 : 0 )); } } xe = bitFloor(xe); ye = bitFloor(ye); xc = xc.slice(); if (a = xe - ye) { if (xLTy = a < 0) { a = -a; t = xc; } else { ye = xe; t = yc; } t.reverse(); for (b = a; b--; t.push(0)) ; t.reverse(); } else { j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; for (a = b = 0; b < j; b++) { if (xc[b] != yc[b]) { xLTy = xc[b] < yc[b]; break; } } } if (xLTy) { t = xc; xc = yc; yc = t; y.s = -y.s; } b = (j = yc.length) - (i = xc.length); if (b > 0) for (; b--; xc[i++] = 0) ; b = BASE - 1; for (; j > a; ) { if (xc[--j] < yc[j]) { for (i = j; i && !xc[--i]; xc[i] = b) ; --xc[i]; xc[j] += BASE; } xc[j] -= yc[j]; } for (; xc[0] == 0; xc.splice(0, 1), --ye) ; if (!xc[0]) { y.s = ROUNDING_MODE == 3 ? -1 : 1; y.c = [y.e = 0]; return y; } return normalise(y, xc, ye); }; P.modulo = P.mod = function(y, b) { var q, s, x = this; y = new BigNumber8(y, b); if (!x.c || !y.s || y.c && !y.c[0]) { return new BigNumber8(NaN); } else if (!y.c || x.c && !x.c[0]) { return new BigNumber8(x); } if (MODULO_MODE == 9) { s = y.s; y.s = 1; q = div(x, y, 0, 3); y.s = s; q.s *= s; } else { q = div(x, y, 0, MODULO_MODE); } y = x.minus(q.times(y)); if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; return y; }; P.multipliedBy = P.times = function(y, b) { var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber8(y, b)).c; if (!xc || !yc || !xc[0] || !yc[0]) { if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { y.c = y.e = y.s = null; } else { y.s *= x.s; if (!xc || !yc) { y.c = y.e = null; } else { y.c = [0]; y.e = 0; } } return y; } e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); y.s *= x.s; xcL = xc.length; ycL = yc.length; if (xcL < ycL) { zc = xc; xc = yc; yc = zc; i = xcL; xcL = ycL; ycL = i; } for (i = xcL + ycL, zc = []; i--; zc.push(0)) ; base = BASE; sqrtBase = SQRT_BASE; for (i = ycL; --i >= 0; ) { c = 0; ylo = yc[i] % sqrtBase; yhi = yc[i] / sqrtBase | 0; for (k = xcL, j = i + k; j > i; ) { xlo = xc[--k] % sqrtBase; xhi = xc[k] / sqrtBase | 0; m = yhi * xlo + xhi * ylo; xlo = ylo * xlo + m % sqrtBase * sqrtBase + zc[j] + c; c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; zc[j--] = xlo % base; } zc[j] = c; } if (c) { ++e; } else { zc.splice(0, 1); } return normalise(y, zc, e); }; P.negated = function() { var x = new BigNumber8(this); x.s = -x.s || null; return x; }; P.plus = function(y, b) { var t, x = this, a = x.s; y = new BigNumber8(y, b); b = y.s; if (!a || !b) return new BigNumber8(NaN); if (a != b) { y.s = -b; return x.minus(y); } var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c; if (!xe || !ye) { if (!xc || !yc) return new BigNumber8(a / 0); if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber8(xc[0] ? x : a * 0); } xe = bitFloor(xe); ye = bitFloor(ye); xc = xc.slice(); if (a = xe - ye) { if (a > 0) { ye = xe; t = yc; } else { a = -a; t = xc; } t.reverse(); for (; a--; t.push(0)) ; t.reverse(); } a = xc.length; b = yc.length; if (a - b < 0) { t = yc; yc = xc; xc = t; b = a; } for (a = 0; b; ) { a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; } if (a) { xc = [a].concat(xc); ++ye; } return normalise(y, xc, ye); }; P.precision = P.sd = function(sd, rm) { var c, n, v, x = this; if (sd != null && sd !== !!sd) { intCheck(sd, 1, MAX); if (rm == null) rm = ROUNDING_MODE; else intCheck(rm, 0, 8); return round2(new BigNumber8(x), sd, rm); } if (!(c = x.c)) return null; v = c.length - 1; n = v * LOG_BASE + 1; if (v = c[v]) { for (; v % 10 == 0; v /= 10, n--) ; for (v = c[0]; v >= 10; v /= 10, n++) ; } if (sd && x.e + 1 > n) n = x.e + 1; return n; }; P.shiftedBy = function(k) { intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); return this.times("1e" + k); }; P.squareRoot = P.sqrt = function() { var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber8("0.5"); if (s !== 1 || !c || !c[0]) { return new BigNumber8(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); } s = Math.sqrt(+valueOf(x)); if (s == 0 || s == 1 / 0) { n = coeffToString(c); if ((n.length + e) % 2 == 0) n += "0"; s = Math.sqrt(+n); e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); if (s == 1 / 0) { n = "5e" + e; } else { n = s.toExponential(); n = n.slice(0, n.indexOf("e") + 1) + e; } r = new BigNumber8(n); } else { r = new BigNumber8(s + ""); } if (r.c[0]) { e = r.e; s = e + dp; if (s < 3) s = 0; for (; ; ) { t = r; r = half.times(t.plus(div(x, t, dp, 1))); if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) { if (r.e < e) --s; n = n.slice(s - 3, s + 1); if (n == "9999" || !rep && n == "4999") { if (!rep) { round2(t, t.e + DECIMAL_PLACES + 2, 0); if (t.times(t).eq(x)) { r = t; break; } } dp += 4; s += 4; rep = 1; } else { if (!+n || !+n.slice(1) && n.charAt(0) == "5") { round2(r, r.e + DECIMAL_PLACES + 2, 1); m = !r.times(r).eq(x); } break; } } } } return round2(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); }; P.toExponential = function(dp, rm) { if (dp != null) { intCheck(dp, 0, MAX); dp++; } return format(this, dp, rm, 1); }; P.toFixed = function(dp, rm) { if (dp != null) { intCheck(dp, 0, MAX); dp = dp + this.e + 1; } return format(this, dp, rm); }; P.toFormat = function(dp, rm, format2) { var str, x = this; if (format2 == null) { if (dp != null && rm && typeof rm == "object") { format2 = rm; rm = null; } else if (dp && typeof dp == "object") { format2 = dp; dp = rm = null; } else { format2 = FORMAT; } } else if (typeof format2 != "object") { throw Error(bignumberError + "Argument not an object: " + format2); } str = x.toFixed(dp, rm); if (x.c) { var i, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length; if (g2) { i = g1; g1 = g2; g2 = i; len -= i; } if (g1 > 0 && len > 0) { i = len % g1 || g1; intPart = intDigits.substr(0, i); for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1); if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); if (isNeg) intPart = "-" + intPart; } str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace( new RegExp("\\d{" + g2 + "}\\B", "g"), "$&" + (format2.fractionGroupSeparator || "") ) : fractionPart) : intPart; } return (format2.prefix || "") + str + (format2.suffix || ""); }; P.toFraction = function(md) { var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c; if (md != null) { n = new BigNumber8(md); if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n)); } } if (!xc) return new BigNumber8(x); d = new BigNumber8(ONE); n1 = d0 = new BigNumber8(ONE); d1 = n0 = new BigNumber8(ONE); s = coeffToString(xc); e = d.e = s.length - x.e - 1; d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n; exp = MAX_EXP; MAX_EXP = 1 / 0; n = new BigNumber8(s); n0.c[0] = 0; for (; ; ) { q = div(n, d, 0, 1); d2 = d0.plus(q.times(d1)); if (d2.comparedTo(md) == 1) break; d0 = d1; d1 = d2; n1 = n0.plus(q.times(d2 = n1)); n0 = d2; d = n.minus(q.times(d2 = d)); n = d2; } d2 = div(md.minus(d0), d1, 0, 1); n0 = n0.plus(d2.times(n1)); d0 = d0.plus(d2.times(d1)); n0.s = n1.s = x.s; e = e * 2; r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( div(n0, d0, e, ROUNDING_MODE).minus(x).abs() ) < 1 ? [n1, d1] : [n0, d0]; MAX_EXP = exp; return r; }; P.toNumber = function() { return +valueOf(this); }; P.toPrecision = function(sd, rm) { if (sd != null) intCheck(sd, 1, MAX); return format(this, sd, rm, 2); }; P.toString = function(b) { var str, n = this, s = n.s, e = n.e; if (e === null) { if (s) { str = "Infinity"; if (s < 0) str = "-" + str; } else { str = "NaN"; } } else { if (b == null) { str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0"); } else if (b === 10 && alphabetHasNormalDecimalDigits) { n = round2(new BigNumber8(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE); str = toFixedPoint(coeffToString(n.c), n.e, "0"); } else { intCheck(b, 2, ALPHABET.length, "Base"); str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true); } if (s < 0 && n.c[0]) str = "-" + str; } return str; }; P.valueOf = P.toJSON = function() { return valueOf(this); }; P._isBigNumber = true; if (configObject != null) BigNumber8.set(configObject); return BigNumber8; } function bitFloor(n) { var i = n | 0; return n > 0 || n === i ? i : i - 1; } function coeffToString(a) { var s, z, i = 1, j = a.length, r = a[0] + ""; for (; i < j; ) { s = a[i++] + ""; z = LOG_BASE - s.length; for (; z--; s = "0" + s) ; r += s; } for (j = r.length; r.charCodeAt(--j) === 48; ) ; return r.slice(0, j + 1 || 1); } function compare(x, y) { var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e; if (!i || !j) return null; a = xc && !xc[0]; b = yc && !yc[0]; if (a || b) return a ? b ? 0 : -j : i; if (i != j) return i; a = i < 0; b = k == l; if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; if (!b) return k > l ^ a ? 1 : -1; j = (k = xc.length) < (l = yc.length) ? k : l; for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; return k == l ? 0 : k > l ^ a ? 1 : -1; } function intCheck(n, min2, max2, name) { if (n < min2 || n > max2 || n !== mathfloor(n)) { throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min2 || n > max2 ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n)); } } function isOdd(n) { var k = n.c.length - 1; return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; } function toExponential(str, e) { return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e; } function toFixedPoint(str, e, z) { var len, zs; if (e < 0) { for (zs = z + "."; ++e; zs += z) ; str = zs + str; } else { len = str.length; if (++e > len) { for (zs = z, e -= len; --e; zs += z) ; str += zs; } else if (e < len) { str = str.slice(0, e) + "." + str.slice(e); } } return str; } BigNumber7 = clone(); BigNumber7["default"] = BigNumber7.BigNumber = BigNumber7; if (typeof define == "function" && define.amd) { define(function() { return BigNumber7; }); } else if (typeof module != "undefined" && module.exports) { module.exports = BigNumber7; } else { if (!globalObject) { globalObject = typeof self != "undefined" && self ? self : window; } globalObject.BigNumber = BigNumber7; } })(exports); } }); // node_modules/sweetalert/lib/modules/handle-dom.js var require_handle_dom = __commonJS({ "node_modules/sweetalert/lib/modules/handle-dom.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var hasClass = function hasClass2(elem, className) { return new RegExp(" " + className + " ").test(" " + elem.className + " "); }; var addClass = function addClass2(elem, className) { if (!hasClass(elem, className)) { elem.className += " " + className; } }; var removeClass = function removeClass2(elem, className) { var newClass = " " + elem.className.replace(/[\t\r\n]/g, " ") + " "; if (hasClass(elem, className)) { while (newClass.indexOf(" " + className + " ") >= 0) { newClass = newClass.replace(" " + className + " ", " "); } elem.className = newClass.replace(/^\s+|\s+$/g, ""); } }; var escapeHtml = function escapeHtml2(str) { var div = document.createElement("div"); div.appendChild(document.createTextNode(str)); return div.innerHTML; }; var _show = function _show2(elem) { elem.style.opacity = ""; elem.style.display = "block"; }; var show = function show2(elems) { if (elems && !elems.length) { return _show(elems); } for (var i = 0; i < elems.length; ++i) { _show(elems[i]); } }; var _hide = function _hide2(elem) { elem.style.opacity = ""; elem.style.display = "none"; }; var hide2 = function hide3(elems) { if (elems && !elems.length) { return _hide(elems); } for (var i = 0; i < elems.length; ++i) { _hide(elems[i]); } }; var isDescendant = function isDescendant2(parent, child) { var node = child.parentNode; while (node !== null) { if (node === parent) { return true; } node = node.parentNode; } return false; }; var getTopMargin = function getTopMargin2(elem) { elem.style.left = "-9999px"; elem.style.display = "block"; var height = elem.clientHeight, padding; if (typeof getComputedStyle !== "undefined") { padding = parseInt(getComputedStyle(elem).getPropertyValue("padding-top"), 10); } else { padding = parseInt(elem.currentStyle.padding); } elem.style.left = ""; elem.style.display = "none"; return "-" + parseInt((height + padding) / 2) + "px"; }; var fadeIn = function fadeIn2(elem, interval) { if (+elem.style.opacity < 1) { interval = interval || 16; elem.style.opacity = 0; elem.style.display = "block"; var last = +/* @__PURE__ */ new Date(); var tick = function(_tick) { function tick2() { return _tick.apply(this, arguments); } tick2.toString = function() { return _tick.toString(); }; return tick2; }(function() { elem.style.opacity = +elem.style.opacity + (/* @__PURE__ */ new Date() - last) / 100; last = +/* @__PURE__ */ new Date(); if (+elem.style.opacity < 1) { setTimeout(tick, interval); } }); tick(); } elem.style.display = "block"; }; var fadeOut = function fadeOut2(elem, interval) { interval = interval || 16; elem.style.opacity = 1; var last = +/* @__PURE__ */ new Date(); var tick = function(_tick2) { function tick2() { return _tick2.apply(this, arguments); } tick2.toString = function() { return _tick2.toString(); }; return tick2; }(function() { elem.style.opacity = +elem.style.opacity - (/* @__PURE__ */ new Date() - last) / 100; last = +/* @__PURE__ */ new Date(); if (+elem.style.opacity > 0) { setTimeout(tick, interval); } else { elem.style.display = "none"; } }); tick(); }; var fireClick = function fireClick2(node) { if (typeof MouseEvent === "function") { var mevt = new MouseEvent("click", { view: window, bubbles: false, cancelable: true }); node.dispatchEvent(mevt); } else if (document.createEvent) { var evt = document.createEvent("MouseEvents"); evt.initEvent("click", false, false); node.dispatchEvent(evt); } else if (document.createEventObject) { node.fireEvent("onclick"); } else if (typeof node.onclick === "function") { node.onclick(); } }; var stopEventPropagation = function stopEventPropagation2(e) { if (typeof e.stopPropagation === "function") { e.stopPropagation(); e.preventDefault(); } else if (window.event && window.event.hasOwnProperty("cancelBubble")) { window.event.cancelBubble = true; } }; exports.hasClass = hasClass; exports.addClass = addClass; exports.removeClass = removeClass; exports.escapeHtml = escapeHtml; exports._show = _show; exports.show = show; exports._hide = _hide; exports.hide = hide2; exports.isDescendant = isDescendant; exports.getTopMargin = getTopMargin; exports.fadeIn = fadeIn; exports.fadeOut = fadeOut; exports.fireClick = fireClick; exports.stopEventPropagation = stopEventPropagation; } }); // node_modules/sweetalert/lib/modules/utils.js var require_utils = __commonJS({ "node_modules/sweetalert/lib/modules/utils.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var extend3 = function extend4(a, b) { for (var key in b) { if (b.hasOwnProperty(key)) { a[key] = b[key]; } } return a; }; var hexToRgb = function hexToRgb2(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? parseInt(result[1], 16) + ", " + parseInt(result[2], 16) + ", " + parseInt(result[3], 16) : null; }; var isIE8 = function isIE82() { return window.attachEvent && !window.addEventListener; }; var logStr2 = function logStr3(string) { if (window.console) { window.console.log("SweetAlert: " + string); } }; var colorLuminance = function colorLuminance2(hex, lum) { hex = String(hex).replace(/[^0-9a-f]/gi, ""); if (hex.length < 6) { hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; } lum = lum || 0; var rgb = "#"; var c; var i; for (i = 0; i < 3; i++) { c = parseInt(hex.substr(i * 2, 2), 16); c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16); rgb += ("00" + c).substr(c.length); } return rgb; }; exports.extend = extend3; exports.hexToRgb = hexToRgb; exports.isIE8 = isIE8; exports.logStr = logStr2; exports.colorLuminance = colorLuminance; } }); // node_modules/sweetalert/lib/modules/default-params.js var require_default_params = __commonJS({ "node_modules/sweetalert/lib/modules/default-params.js"(exports, module) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var defaultParams = { title: "", text: "", type: null, allowOutsideClick: false, showConfirmButton: true, showCancelButton: false, closeOnConfirm: true, closeOnCancel: true, confirmButtonText: "OK", confirmButtonColor: "#8CD4F5", cancelButtonText: "Cancel", imageUrl: null, imageSize: null, timer: null, customClass: "", html: false, animation: true, allowEscapeKey: true, inputType: "text", inputPlaceholder: "", inputValue: "", showLoaderOnConfirm: false }; exports["default"] = defaultParams; module.exports = exports["default"]; } }); // node_modules/sweetalert/lib/modules/injected-html.js var require_injected_html = __commonJS({ "node_modules/sweetalert/lib/modules/injected-html.js"(exports, module) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var injectedHTML = ( // Dark overlay '
Text
\nNot valid!
\n